Home | History | Annotate | Download | only in class.nest
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 // C++0x [class.nest] p3:
      4 //   If class X is defined in a namespace scope, a nested class Y may be
      5 //   declared in class X and later defined in the definition of class X or be
      6 //   later defined in a namespace scope enclosing the definition of class X.
      7 
      8 namespace example {
      9   class E {
     10     class I1;
     11     class I2;
     12     class I1 { };
     13   };
     14   class E::I2 { };
     15 }
     16 
     17 // Don't insert out-of-line inner class definitions into the namespace scope.
     18 namespace PR6107 {
     19   struct S1 { };
     20   struct S2 {
     21     struct S1;
     22   };
     23   struct S2::S1 { };
     24   S1 s1;
     25 }
     26