diff options
author | John McCall <rjmccall@apple.com> | 2010-04-10 09:28:51 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-10 09:28:51 +0000 |
commit | 3c3ccdbe73cb43bdf39a9102f5f7eb842fb71952 (patch) | |
tree | 33d3d427b0fd948fcd0859460e50000c93430a80 /test/SemaCXX/constructor-initializer.cpp | |
parent | d6ca8da0f5a4115813055729faaa5128e994806d (diff) |
Diagnose more cases of initializing distinct members of an anonymous union
member. Use a better diagnostic for this case. Also fix a bug with nested
anonymous structs/unions for -Wreorder; this last was PR6575.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | test/SemaCXX/constructor-initializer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index a22c417032..c0e1281375 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/test/SemaCXX/constructor-initializer.cpp @@ -73,8 +73,9 @@ class U { union { int a; char* p; }; union { int b; double d; }; - U() : a(1), p(0), d(1.0) {} // expected-error {{multiple initializations given for non-static member 'p'}} \ - // expected-note {{previous initialization is here}} + U() : a(1), // expected-note {{previous initialization is here}} + p(0), // expected-error {{initializing multiple members of anonymous union}} + d(1.0) {} }; struct V {}; |