forked from OSchip/llvm-project
Make sure that the type associated with a class template is dependent.
llvm-svn: 71878
This commit is contained in:
parent
9d73cabf22
commit
1ec5e9f025
|
@ -264,7 +264,8 @@ public:
|
|||
|
||||
static CXXRecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
|
||||
SourceLocation L, IdentifierInfo *Id,
|
||||
CXXRecordDecl* PrevDecl=0);
|
||||
CXXRecordDecl* PrevDecl=0,
|
||||
bool DelayTypeCreation = false);
|
||||
|
||||
/// setBases - Sets the base classes of this struct or class.
|
||||
void setBases(CXXBaseSpecifier const * const *Bases, unsigned NumBases);
|
||||
|
|
|
@ -35,9 +35,11 @@ CXXRecordDecl::CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC,
|
|||
|
||||
CXXRecordDecl *CXXRecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC,
|
||||
SourceLocation L, IdentifierInfo *Id,
|
||||
CXXRecordDecl* PrevDecl) {
|
||||
CXXRecordDecl* PrevDecl,
|
||||
bool DelayTypeCreation) {
|
||||
CXXRecordDecl* R = new (C) CXXRecordDecl(CXXRecord, TK, DC, L, Id);
|
||||
C.getTypeDeclType(R, PrevDecl);
|
||||
if (!DelayTypeCreation)
|
||||
C.getTypeDeclType(R, PrevDecl);
|
||||
return R;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue