p1.cpp revision 2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3class Outer {
4  int x;
5  static int sx;
6  int f();
7
8  // C++0x does relax this rule (see 5.1.1.10) in the first case, but we need to enforce it in C++03 mode.
9  class Inner {
10    static char a[sizeof(x)]; // expected-error {{invalid use of nonstatic data member 'x'}}
11    static char b[sizeof(sx)]; // okay
12    static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}}
13  };
14};
15