diff options
-rw-r--r-- | test/CXX/class/class.union/p2-0x.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CXX/class/class.union/p2-0x.cpp b/test/CXX/class/class.union/p2-0x.cpp index d353bda27c..b5c410925c 100644 --- a/test/CXX/class/class.union/p2-0x.cpp +++ b/test/CXX/class/class.union/p2-0x.cpp @@ -34,3 +34,15 @@ union U3 { static const int k; U3() : k(0) {} // expected-error {{does not name a non-static data member}} }; + +struct S { + union { + static const int n; // expected-error {{static members cannot be declared in an anonymous union}} + int a; + int b; + }; +}; +static union { + static const int k; // expected-error {{static members cannot be declared in an anonymous union}} + int n; +}; |