assert(Kind >= DeclarationName::CXXConstructorName &&
Kind <= DeclarationName::CXXConversionFunctionName &&
"Kind must be a C++ special name kind");
-
+ assert(Ty->isCanonical() &&
+ "Can only build C++ special names from canonical types");
llvm::FoldingSet<CXXSpecialName> *SpecialNames
= static_cast<llvm::FoldingSet<CXXSpecialName>*>(CXXSpecialNamesImpl);
CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
QualType ClassTy = SemaRef.Context.getTypeDeclType(Record);
DeclarationName Name
- = SemaRef.Context.DeclarationNames.getCXXConstructorName(ClassTy);
+ = SemaRef.Context.DeclarationNames.getCXXConstructorName(
+ SemaRef.Context.getCanonicalType(ClassTy));
CXXConstructorDecl *Constructor
= CXXConstructorDecl::Create(SemaRef.Context, Record, D->getLocation(),
Name, T, D->isExplicit(), D->isInline(),
SemaRef.CheckFunctionDeclaration(Constructor, PrevDecl, Redeclaration,
/*FIXME:*/OverloadableAttrRequired);
+ Record->addedConstructor(SemaRef.Context, Constructor);
Owner->addDecl(SemaRef.Context, Constructor);
return Constructor;
}
// Build the instantiated destructor declaration.
CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
- QualType ClassTy = SemaRef.Context.getTypeDeclType(Record);
+ QualType ClassTy =
+ SemaRef.Context.getCanonicalType(SemaRef.Context.getTypeDeclType(Record));
CXXDestructorDecl *Destructor
= CXXDestructorDecl::Create(SemaRef.Context, Record,
D->getLocation(),