p1.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -fsyntax-only -verify %s 2 3class Outer { 4 int x; 5 static int sx; 6 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). 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}; 15