Make sure we still reject static data members in anonymous unions in C++11.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150724 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CXX/class/class.union/p2-0x.cpp b/test/CXX/class/class.union/p2-0x.cpp
index d353bda..b5c4109 100644
--- a/test/CXX/class/class.union/p2-0x.cpp
+++ b/test/CXX/class/class.union/p2-0x.cpp
@@ -34,3 +34,15 @@
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;
+};