Debian Codegraph @

gcc/testsuite/g++.dg/analyzer/ctor-dtor-1.C

raw
1 #include "../../gcc.dg/analyzer/analyzer-decls.h"
2
3 int foo_count;
4
5 struct foo
6 {
7 foo () __attribute__((noinline))
8 {
9 foo_count++;
10 }
11 ~foo () __attribute__((noinline))
12 {
13 foo_count--;
14 }
15 };
16
17 int main ()
18 {
19 __analyzer_eval (foo_count == 0); // { dg-warning "TRUE" }
20 {
21 foo f;
22 __analyzer_eval (foo_count == 1); // { dg-warning "TRUE" }
23 }
24 __analyzer_eval (foo_count == 0); // { dg-warning "TRUE" }
25 return 0;
26 }