[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CXX / class / class.nest / p3.cpp
blob677411fe3c8a91a16c50569e2a0de05e407d26b6
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
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.
9 namespace example {
10 class E {
11 class I1;
12 class I2;
13 class I1 { };
15 class E::I2 { };
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;
24 struct S2::S1 { };
25 S1 s1;