Exemple #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}}
  }
Exemple #2
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}}
  }