Files
clang-p2996/clang/test/Analysis/temp-obj-dtors-option.cpp
Alexander Kornienko a61d4c959a Remove explicit cfg-temporary-dtors=true
Summary:
Remove explicit -analyzer-config cfg-temporary-dtors=true in analyzer tests,
since this option defaults to true since r326461.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D46393

llvm-svn: 331520
2018-05-04 14:13:14 +00:00

23 lines
538 B
C++

// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=false -verify %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-temp-dtor-inlining=true -DINLINE -verify %s
void clang_analyzer_eval(bool);
struct S {
int &x;
S(int &x) : x(x) { ++x; }
~S() { --x; }
};
void foo() {
int x = 0;
S(x).x += 1;
clang_analyzer_eval(x == 1);
#ifdef INLINE
// expected-warning@-2{{TRUE}}
#else
// expected-warning@-4{{UNKNOWN}}
#endif
}