27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4// C++0x [class.nest] p3:5// If class X is defined in a namespace scope, a nested class Y may be6// declared in class X and later defined in the definition of class X or be7// later defined in a namespace scope enclosing the definition of class X.8 9namespace example {10 class E {11 class I1;12 class I2;13 class I1 { };14 };15 class E::I2 { };16}17 18// Don't insert out-of-line inner class definitions into the namespace scope.19namespace PR6107 {20 struct S1 { };21 struct S2 {22 struct S1;23 };24 struct S2::S1 { };25 S1 s1;26}27