1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-allocator-inlining=true -std=c++11 -verify -analyzer-config eagerly-assume=false %s
3 void clang_analyzer_eval(bool);
5 typedef __typeof__(sizeof(int)) size_t;
10 void *operator new(size_t size
) throw() {
23 void checkNewAndConstructorInlining() {
25 // Check that the symbol for 's' is not dying.
26 clang_analyzer_eval(s
!= 0); // expected-warning{{TRUE}}
27 // Check that bindings are correct (and also not dying).
28 clang_analyzer_eval(s
->x
== 1); // expected-warning{{TRUE}}
37 void checkNestedNew() {
38 Sp
*p
= new Sp(new Sp(0));
39 clang_analyzer_eval(p
->p
->p
== 0); // expected-warning{{TRUE}}
44 clang_analyzer_eval(*i
== 0); // expected-warning{{UNKNOWN}}
46 clang_analyzer_eval(*j
== 0); // expected-warning{{TRUE}}
48 clang_analyzer_eval(*k
== 5); // expected-warning{{TRUE}}
51 void checkTrivialCopy() {
53 S
*t
= new S(s
); // no-crash
54 clang_analyzer_eval(t
->x
== 1); // expected-warning{{TRUE}}