1// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s
2// expected-no-diagnostics
3class B {
4public:
5  bool m;
6  ~B() {} // The destructor ensures that the binary logical operator below is wrapped in the ExprWithCleanups.
7};
8B foo();
9int getBool();
10int *getPtr();
11int 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
20    }
21  }
22  return r;
23}
24