[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Analysis / live-variables.cpp
blob2c38b8bd7134c3c478e0c1c7a0944fa102593f42
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // expected-no-diagnostics
3 class B {
4 public:
5 bool m;
6 ~B() {} // The destructor ensures that the binary logical operator below is wrapped in the ExprWithCleanups.
7 };
8 B foo();
9 int getBool();
10 int *getPtr();
11 int test() {
12 int r = 0;
13 for (int x = 0; x< 10; x++) {
14 int *p = getPtr();
15 // Liveness info is not computed correctly due to the following expression.
16 // This happens due to CFG being special cased for short circuit operators.
17 // PR18159
18 if (p != 0 && getBool() && foo().m && getBool()) {
19 r = *p; // no warning
22 return r;