summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-31 07:04:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-31 07:04:33 +0000
commitb85cd7c312aecd9f6837e69a47e12d98f3307530 (patch)
tree7abcddcdd6bdee39bc2c77498946580215d7ea1a /clang/test/SemaCXX/class.cpp
parent8322b426a56db0ecaf99c565746ed04448cd29b1 (diff)
downloadbcm5719-llvm-b85cd7c312aecd9f6837e69a47e12d98f3307530.tar.gz
bcm5719-llvm-b85cd7c312aecd9f6837e69a47e12d98f3307530.zip
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
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-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