Error for use of field from anonymous struct or union should say "invalid use of nonstatic data member"
not "call to non-static member function without an object argument".
llvm-svn: 124576
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp
index 7c6a62f..52140cb 100644
--- a/clang/test/SemaCXX/class.cpp
+++ b/clang/test/SemaCXX/class.cpp
@@ -176,3 +176,15 @@
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}}
+}
+}