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 | 23eebd9c1ee86e29efc84eccca21880993e8ce8e (patch) | |
tree | 5622a80934bdbf354ad46d93eef3778de42c265c /clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp | |
parent | bb7b658ab5d0e46a7a5af11bfdba8cac80173307 (diff) | |
download | bcm5719-llvm-23eebd9c1ee86e29efc84eccca21880993e8ce8e.tar.gz bcm5719-llvm-23eebd9c1ee86e29efc84eccca21880993e8ce8e.zip |
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
Diffstat (limited to 'clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp b/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp index 15e0867b263..3ff01af3627 100644 --- a/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp +++ b/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp @@ -108,3 +108,15 @@ namespace test2 { Foo y; }; } + +// PR6575: this should not crash +namespace test3 { + struct MyClass { + MyClass() : m_int(0) {} + union { + struct { + int m_int; + }; + }; + }; +} |