summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/class.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp
index 7c6a62f41e1..52140cb0743 100644
--- a/clang/test/SemaCXX/class.cpp
+++ b/clang/test/SemaCXX/class.cpp
@@ -176,3 +176,15 @@ namespace rdar8367341 {
static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a C++0x extension}} expected-error {{in-class initializer is not a constant expression}}
};
}
+
+namespace with_anon {
+struct S {
+ union {
+ char c;
+ };
+};
+
+void f() {
+ S::c; // expected-error {{invalid use of nonstatic data member}}
+}
+}
OpenPOWER on IntegriCloud