blob: a78dee2bd3111d2e609b0989751ee74c91eb06cc [file] [log] [blame]
George Karpenkova393e682018-08-29 20:29:17 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=false -verify -analyzer-config eagerly-assume=false %s
2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=true -DINLINE -verify -analyzer-config eagerly-assume=false %s
Artem Dergachev661ab342018-02-15 19:17:44 +00003
4void clang_analyzer_eval(bool);
5
6struct S {
7 int &x;
8
9 S(int &x) : x(x) { ++x; }
10 ~S() { --x; }
11};
12
13void foo() {
14 int x = 0;
15 S(x).x += 1;
16 clang_analyzer_eval(x == 1);
17#ifdef INLINE
18 // expected-warning@-2{{TRUE}}
19#else
20 // expected-warning@-4{{UNKNOWN}}
21#endif
22}