blob: 25cc86ebde4350199b5150b606bea9325563568d [file] [log] [blame]
Alexander Kornienkoa61d4c92018-05-04 14:13:14 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=false -verify %s
2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=true -DINLINE -verify %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}