diff options
author | John McCall <rjmccall@apple.com> | 2009-08-05 23:56:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-08-05 23:56:26 +0000 |
commit | e9472787be0202e80931d51f108e46dc677cf50c (patch) | |
tree | f712e8893c5929ebebc7d307a091f8b6ea7fcfe1 | |
parent | 47a434ff3d49e7906eda88e8e8242e4297725b32 (diff) |
Add a test for invalid uses of non-static members from nested classes, just
because I was thinking about it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78262 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CXX/class/class.nest/p1.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CXX/class/class.nest/p1.cpp b/test/CXX/class/class.nest/p1.cpp new file mode 100644 index 0000000000..49e1bd2353 --- /dev/null +++ b/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 + }; +}; |