1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 
4 // C++0x [class.nest] p3:
5 //   If class X is defined in a namespace scope, a nested class Y may be
6 //   declared in class X and later defined in the definition of class X or be
7 //   later defined in a namespace scope enclosing the definition of class X.
8 
9 namespace 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.
19 namespace PR6107 {
20   struct S1 { };
21   struct S2 {
22     struct S1;
23   };
24   struct S2::S1 { };
25   S1 s1;
26 }
27