Files
codeql/cpp/ql/test/library-tests/dataflow/fields/C.cpp
2020-05-14 15:33:02 +02:00

38 lines
487 B
C++

class C
{
class Elem
{
};
private:
Elem *s1 = new Elem();
const Elem *s2 = new Elem();
Elem *s3;
public:
const static Elem *s4;
void main(void)
{
C *c = new C();
c->func();
}
C() : s1(new Elem())
{
this->s3 = new Elem();
}
void func()
{
sink(s1); // $ast $f-:ir
sink(s2); // $f-:ast $f-:ir
sink(s3); // $ast $f-:ir
sink(s4); // $f-:ast $f-:ir
}
static void sink(const void *o) {}
};
const C::Elem *C::s4 = new Elem();