diff options
Diffstat (limited to 'test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | test/SemaCXX/uninitialized.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaCXX/uninitialized.cpp b/test/SemaCXX/uninitialized.cpp index 890f212930..385548b51c 100644 --- a/test/SemaCXX/uninitialized.cpp +++ b/test/SemaCXX/uninitialized.cpp @@ -378,3 +378,22 @@ namespace statics { } } } + +namespace references { + int &a = a; // expected-warning{{variable 'a' is uninitialized when used within its own initialization}} + + struct S { + S() : a(a) {} // expected-warning{{field is uninitialized when used here}} + int &a; + }; + + void f() { + int &a = a; // expected-warning{{variable 'a' is uninitialized when used within its own initialization}} + } + + struct T { + T() : a(b), b(a) {} // FIXME: Warn here. + int &a, &b; + int &c = c; // FIXME: Warn here. + }; +} |