[cfe-commits] r78262 - /cfe/trunk/test/CXX/class/class.nest/p1.cpp

John McCall rjmccall at apple.com
Wed Aug 5 16:56:39 PDT 2009


Author: rjmccall
Date: Wed Aug  5 18:56:26 2009
New Revision: 78262

URL: http://llvm.org/viewvc/llvm-project?rev=78262&view=rev
Log:
Add a test for invalid uses of non-static members from nested classes, just
because I was thinking about it.


Added:
    cfe/trunk/test/CXX/class/class.nest/p1.cpp

Added: cfe/trunk/test/CXX/class/class.nest/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.nest/p1.cpp?rev=78262&view=auto

==============================================================================
--- cfe/trunk/test/CXX/class/class.nest/p1.cpp (added)
+++ cfe/trunk/test/CXX/class/class.nest/p1.cpp Wed Aug  5 18:56:26 2009
@@ -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
+  };
+};





More information about the cfe-commits mailing list