summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-08-05 23:56:26 +0000
committerJohn McCall <rjmccall@apple.com>2009-08-05 23:56:26 +0000
commit13c5a27c9aff2e4fa44876862b302f9db6170c97 (patch)
tree21751af1d5a233620bcae0b1d6ad5b544382ad21
parentdd611f44cb55d219cd83e7f4c28ef9c8c0fbae46 (diff)
downloadbcm5719-llvm-13c5a27c9aff2e4fa44876862b302f9db6170c97.tar.gz
bcm5719-llvm-13c5a27c9aff2e4fa44876862b302f9db6170c97.zip
Add a test for invalid uses of non-static members from nested classes, just
because I was thinking about it. llvm-svn: 78262
-rw-r--r--clang/test/CXX/class/class.nest/p1.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CXX/class/class.nest/p1.cpp b/clang/test/CXX/class/class.nest/p1.cpp
new file mode 100644
index 00000000000..49e1bd23539
--- /dev/null
+++ b/clang/test/CXX/class/class.nest/p1.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+class Outer {
+ int x;
+ static int sx;
+
+ class Inner {
+ static char a[sizeof(x)]; // expected-error {{ invalid use of nonstatic data member 'x' }}
+ static char b[sizeof(sx)]; // okay
+ };
+};
OpenPOWER on IntegriCloud