John McCall | e947278 | 2009-08-05 23:56:26 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | class Outer { |
| 4 | int x; |
| 5 | static int sx; |
| 6 | |
John McCall | 213a60e | 2009-08-06 00:50:46 +0000 | [diff] [blame^] | 7 | // C++0x will likely relax this rule in this specific case, but |
| 8 | // we'll still need to enforce it in C++03 mode. See N2253 (or |
| 9 | // successor). |
John McCall | e947278 | 2009-08-05 23:56:26 +0000 | [diff] [blame] | 10 | class Inner { |
| 11 | static char a[sizeof(x)]; // expected-error {{ invalid use of nonstatic data member 'x' }} |
| 12 | static char b[sizeof(sx)]; // okay |
| 13 | }; |
| 14 | }; |