From 23eebd9c1ee86e29efc84eccca21880993e8ce8e Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 10 Apr 2010 09:28:51 +0000 Subject: 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. llvm-svn: 100923 --- clang/test/SemaCXX/constructor-initializer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/test/SemaCXX/constructor-initializer.cpp') diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index a22c4170324..c0e12813752 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/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 {}; -- cgit v1.2.3