Take care another assert:
struct A {
struct B;
};
struct A::B {
void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};
Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:
namespace A {
struct S;
}
struct A::S {}; // getParent() == namespace 'A'
// getLexicalParent() == translation unit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59650 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp
index b22d8dc..18cb3b4 100644
--- a/test/SemaCXX/nested-name-spec.cpp
+++ b/test/SemaCXX/nested-name-spec.cpp
@@ -45,12 +45,19 @@
namespace A2 {
typedef int INT;
struct RC;
+ struct CC {
+ struct NC;
+ };
}
struct A2::RC {
INT x;
};
+struct A2::CC::NC {
+ void m() {}
+};
+
void f3() {
N::x = 0; // expected-error {{use of undeclared identifier 'N'}}
int N;