示例#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}}
  }
示例#2
0
  void testDevirtualizeToMiddle() {
    Grandchild x;
    x.m_child = 42;

    // Don't crash when inlining and devirtualizing.
    x.interface();
  }
示例#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}}
  }