diff options
Diffstat (limited to 'test/Analysis/ctor.mm')
| -rw-r--r-- | test/Analysis/ctor.mm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Analysis/ctor.mm b/test/Analysis/ctor.mm index 77c87905e1f74..e7c0c6cac630e 100644 --- a/test/Analysis/ctor.mm +++ b/test/Analysis/ctor.mm @@ -674,3 +674,33 @@ namespace InitializerList { clang_analyzer_eval(list->usedInitializerList); // expected-warning{{UNKNOWN}} } } + +namespace PR19579 { + class C {}; + + void f() { + C(); + int a; + + extern void use(int); + use(a); // expected-warning{{uninitialized}} + } + + void g() { + struct S { + C c; + int i; + }; + + // This order triggers the initialization of the inner "a" after the + // constructor for "C" is run, which used to confuse the analyzer + // (is "C()" the initialization of "a"?). + struct S s = { + C(), + ({ + int a, b = 0; + 0; + }) + }; + } +} |
