summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-15 19:11:46 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-15 19:11:46 +0000
commit1ec5e9f025a40354aff126f7cb5d7b4ead4546c5 (patch)
tree36575a38cedbe7640dc27a6d38a5404231fee605 /clang/lib/Sema
parent9d73cabf22b970ec47eaae9b01ca55430f426618 (diff)
downloadbcm5719-llvm-1ec5e9f025a40354aff126f7cb5d7b4ead4546c5.tar.gz
bcm5719-llvm-1ec5e9f025a40354aff126f7cb5d7b4ead4546c5.zip
Make sure that the type associated with a class template is dependent.
llvm-svn: 71878
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 09e32f7b65c..afd801cf619 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -509,7 +509,8 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
CXXRecordDecl *NewClass =
CXXRecordDecl::Create(Context, Kind, SemanticContext, NameLoc, Name,
PrevClassTemplate?
- PrevClassTemplate->getTemplatedDecl() : 0);
+ PrevClassTemplate->getTemplatedDecl() : 0,
+ /*DelayTypeCreation=*/true);
ClassTemplateDecl *NewTemplate
= ClassTemplateDecl::Create(Context, SemanticContext, NameLoc,
@@ -517,6 +518,14 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
NewClass, PrevClassTemplate);
NewClass->setDescribedClassTemplate(NewTemplate);
+ // Build the type for the class template declaration now.
+ QualType T =
+ Context.getTypeDeclType(NewClass,
+ PrevClassTemplate?
+ PrevClassTemplate->getTemplatedDecl() : 0);
+ assert(T->isDependentType() && "Class template type is not dependent?");
+ (void)T;
+
// Set the access specifier.
SetMemberAccessSpecifier(NewTemplate, PrevClassTemplate, AS);
OpenPOWER on IntegriCloud