xref: /llvm-project/clang/test/Analysis/analysis-after-multiple-dtors.cpp (revision d65379c8d4768ddae143672f5d4827acafe22553)
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 
3 #include "Inputs/system-header-simulator-cxx.h"
4 
5 struct Test {
TestTest6   Test() {}
7   ~Test();
8 };
9 
foo()10 int foo() {
11   struct a {
12   // The dtor invocation of 'b' and 'c' used to create
13   // a loop in the egraph and the analysis stopped after
14   // this point.
15     Test b, c;
16   } d;
17   return 1;
18 }
19 
main()20 int main() {
21   if (foo()) {
22   }
23 
24   int x;
25   int y = x;
26   // expected-warning@-1{{Assigned value is garbage or undefined}}
27   (void)y;
28 }
29