diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-11-19 18:01:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-11-19 18:01:13 +0000 |
commit | 77407b802130b1c44b1f63b855722a5376f57bca (patch) | |
tree | 4005f53b992648d8a730bc9b03543920dd985646 /test/SemaCXX/nested-name-spec.cpp | |
parent | a468d34bed16861f25aff6c8354f4e75d3358c1a (diff) |
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
Diffstat (limited to 'test/SemaCXX/nested-name-spec.cpp')
-rw-r--r-- | test/SemaCXX/nested-name-spec.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp index b22d8dc3d4..18cb3b418a 100644 --- a/test/SemaCXX/nested-name-spec.cpp +++ b/test/SemaCXX/nested-name-spec.cpp @@ -45,12 +45,19 @@ struct A::undef; // expected-error {{'undef' does not name a tag member in the s 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; |