summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp16
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp4
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp2
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp4
4 files changed, 13 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a21502961a2..44ee2ebbf0c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1553,21 +1553,21 @@ DeclarationName Sema::GetNameForDeclarator(Declarator &D) {
case Declarator::DK_Constructor: {
QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType());
- Ty = Context.getCanonicalType(Ty);
- return Context.DeclarationNames.getCXXConstructorName(Ty);
+ return Context.DeclarationNames.getCXXConstructorName(
+ Context.getCanonicalType(Ty));
}
case Declarator::DK_Destructor: {
QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType());
- Ty = Context.getCanonicalType(Ty);
- return Context.DeclarationNames.getCXXDestructorName(Ty);
+ return Context.DeclarationNames.getCXXDestructorName(
+ Context.getCanonicalType(Ty));
}
case Declarator::DK_Conversion: {
// FIXME: We'd like to keep the non-canonical type for diagnostics!
QualType Ty = QualType::getFromOpaquePtr(D.getDeclaratorIdType());
- Ty = Context.getCanonicalType(Ty);
- return Context.DeclarationNames.getCXXConversionFunctionName(Ty);
+ return Context.DeclarationNames.getCXXConversionFunctionName(
+ Context.getCanonicalType(Ty));
}
case Declarator::DK_Operator:
@@ -2736,9 +2736,9 @@ void Sema::CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl,
CXXRecordDecl *Record = cast<CXXRecordDecl>(NewFD->getParent());
QualType ClassType = Context.getTypeDeclType(Record);
if (!ClassType->isDependentType()) {
- ClassType = Context.getCanonicalType(ClassType);
DeclarationName Name
- = Context.DeclarationNames.getCXXDestructorName(ClassType);
+ = Context.DeclarationNames.getCXXDestructorName(
+ Context.getCanonicalType(ClassType));
if (NewFD->getDeclName() != Name) {
Diag(NewFD->getLocation(), diag::err_destructor_name);
return NewFD->setInvalidDecl();
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 76bd71cdce4..0e42a71c597 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -1259,8 +1259,8 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
/// [special]p1). This routine can only be executed just before the
/// definition of the class is complete.
void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
- QualType ClassType = Context.getTypeDeclType(ClassDecl);
- ClassType = Context.getCanonicalType(ClassType);
+ CanQualType ClassType
+ = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
// FIXME: Implicit declarations have exception specifications, which are
// the union of the specifications of the implicitly called functions.
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index e31f9edb61e..2ebd7b184da 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -32,7 +32,7 @@ Sema::ActOnCXXConversionFunctionExpr(Scope *S, SourceLocation OperatorLoc,
const CXXScopeSpec &SS,
bool isAddressOfOperand) {
QualType ConvType = QualType::getFromOpaquePtr(Ty);
- QualType ConvTypeCanon = Context.getCanonicalType(ConvType);
+ CanQualType ConvTypeCanon = Context.getCanonicalType(ConvType);
DeclarationName ConvName
= Context.DeclarationNames.getCXXConversionFunctionName(ConvTypeCanon);
return ActOnDeclarationNameExpr(S, OperatorLoc, ConvName, HasTrailingLParen,
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index abe1fffe880..021a6ad2ab4 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -484,7 +484,7 @@ Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) {
// Build the instantiated destructor declaration.
CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
- QualType ClassTy =
+ CanQualType ClassTy =
SemaRef.Context.getCanonicalType(SemaRef.Context.getTypeDeclType(Record));
CXXDestructorDecl *Destructor
= CXXDestructorDecl::Create(SemaRef.Context, Record,
@@ -517,7 +517,7 @@ Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) {
// Build the instantiated conversion declaration.
CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
QualType ClassTy = SemaRef.Context.getTypeDeclType(Record);
- QualType ConvTy
+ CanQualType ConvTy
= SemaRef.Context.getCanonicalType(T->getAsFunctionType()->getResultType());
CXXConversionDecl *Conversion
= CXXConversionDecl::Create(SemaRef.Context, Record,
OpenPOWER on IntegriCloud