diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-12 23:11:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-12 23:11:44 +0000 |
commit | f0510d49a6985e9284d30cfc36a0df2a6292a638 (patch) | |
tree | 8af7aae63494adfee118a045c8101055d6728616 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 33c4ba87948b7cad1e4ab4848a27b51a259b8981 (diff) |
When declaring a class template whose name is qualified, make sure
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 916e443294..4fd2a734b1 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -390,7 +390,8 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) { CXXRecordDecl *RecordInst = CXXRecordDecl::Create(SemaRef.Context, Pattern->getTagKind(), Owner, Pattern->getLocation(), Pattern->getIdentifier(), - Pattern->getTagKeywordLoc(), /*PrevDecl=*/ NULL); + Pattern->getTagKeywordLoc(), /*PrevDecl=*/ NULL, + /*DelayTypeCreation=*/true); ClassTemplateDecl *Inst = ClassTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(), @@ -398,7 +399,10 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) { RecordInst->setDescribedClassTemplate(Inst); Inst->setAccess(D->getAccess()); Inst->setInstantiatedFromMemberTemplate(D); - + + // Trigger creation of the type for the instantiation. + SemaRef.Context.getTypeDeclType(RecordInst); + Owner->addDecl(Inst); return Inst; } |