blob: bbc49f9e95e7be4713326a59e1089693451e0fee [file] [log] [blame]
John McCalle9472782009-08-05 23:56:26 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3class Outer {
4 int x;
5 static int sx;
6
John McCall213a60e2009-08-06 00:50:46 +00007 // 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 McCalle9472782009-08-05 23:56:26 +000010 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};