Debian Codegraph @

clang/test/Analysis/analysis-after-multiple-dtors.cpp

raw
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2
3 #include "Inputs/system-header-simulator-cxx.h"
4
5 struct Test {
6 Test() {}
7 ~Test();
8 };
9
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
20 int main() {
21 if (foo()) {
22 }
23
24 int x;
25 int y = x;
26 // expected-warning@-1{{Assigned value is uninitialized}}
27 (void)y;
28 }