Ejemplo n.º 1
0
  void testCastViaNew(B *b) {
    Grandchild *g = new (b) Grandchild();
    clang_analyzer_eval(g->foo() == 42); // expected-warning{{TRUE}}

    g->x = 42;
    clang_analyzer_eval(g->x == 42); // expected-warning{{TRUE}}
  }
Ejemplo n.º 2
0
  void testDevirtualizeToMiddle() {
    Grandchild x;
    x.m_child = 42;

    // Don't crash when inlining and devirtualizing.
    x.interface();
  }
Ejemplo n.º 3
0
  void testCastViaNew(B *b) {
    Grandchild *g = new (b) Grandchild();
    // FIXME: We actually now have perfect type info because of 'new'.
    // This should be TRUE.
    clang_analyzer_eval(g->foo() == 42); // expected-warning{{UNKNOWN}}

    g->x = 42;
    clang_analyzer_eval(g->x == 42); // expected-warning{{TRUE}}
  }