From: Douglas Gregor Date: Fri, 5 Feb 2010 04:39:02 +0000 (+0000) Subject: When determining whether a scope specifier is complete, consider a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4e8c2a65a985782344a818d356c40d117fc4f12;p=clang When determining whether a scope specifier is complete, consider a dependent DeclContext to be "complete". Fixes PR6236. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95359 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 7a0b625206..52e9e9bc87 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -241,6 +241,10 @@ bool Sema::RequireCompleteDeclContext(const CXXScopeSpec &SS) { DeclContext *DC = computeDeclContext(SS, true); if (TagDecl *Tag = dyn_cast(DC)) { + // If this is a dependent type, then we consider it complete. + if (Tag->isDependentContext()) + return false; + // If we're currently defining this type, then lookup into the // type is okay: don't complain that it isn't complete yet. const TagType *TagT = Context.getTypeDeclType(Tag)->getAs(); diff --git a/test/SemaTemplate/typename-specifier-4.cpp b/test/SemaTemplate/typename-specifier-4.cpp index 7fd88f130f..9c757c5ad0 100644 --- a/test/SemaTemplate/typename-specifier-4.cpp +++ b/test/SemaTemplate/typename-specifier-4.cpp @@ -68,3 +68,15 @@ struct X0 { void f2(typename X0::Inner::type); // expected-note{{here}} void f2(typename X0::template Inner::type); // expected-error{{redecl}} }; + +namespace PR6236 { + template struct S { }; + + template struct S { + template struct K { }; + + void f() { + typedef typename S::template K Foo; + } + }; +}