From: Douglas Gregor Date: Sun, 8 Nov 2009 07:12:55 +0000 (+0000) Subject: Always make sure we're using an unqualified type when building a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3eaa9ffa176e5d240a0b140b35cc104ee3d63936;p=clang Always make sure we're using an unqualified type when building a constructor name. Fixes PR5418. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86441 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index c7fd5ccd1e..f7c4428611 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1166,7 +1166,7 @@ Sema::BuildBaseInitializer(QualType BaseType, Expr **Args, CXXConstructorDecl *C = 0; if (!BaseType->isDependentType() && !HasDependentArg) { DeclarationName Name = Context.DeclarationNames.getCXXConstructorName( - Context.getCanonicalType(BaseType)); + Context.getCanonicalType(BaseType).getUnqualifiedType()); ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this); C = PerformInitializationByConstructor(BaseType, @@ -3450,7 +3450,7 @@ Sema::PerformInitializationByConstructor(QualType ClassType, // Add constructors to the overload set. DeclarationName ConstructorName = Context.DeclarationNames.getCXXConstructorName( - Context.getCanonicalType(ClassType.getUnqualifiedType())); + Context.getCanonicalType(ClassType).getUnqualifiedType()); DeclContext::lookup_const_iterator Con, ConEnd; for (llvm::tie(Con, ConEnd) = ClassDecl->lookup(ConstructorName); Con != ConEnd; ++Con) {