From c712ce1b607d48bd6569bd880ea6da92c61a323e Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 30 Dec 2009 04:10:01 +0000 Subject: More fixes to the handling of CVR-comparisons on array types. Adds a method to QualType to get CVR-qualifiers through array types, and switches the primary comparison methods to use it. This may allow simplifying some of the callers of getUnqualifiedArrayType. Also fix the normalizing of CV-qualification during template deduction to normalize through arrays and allow a more qualified deduced array type. This fixes PR5911. llvm-svn: 92289 --- clang/lib/Sema/SemaTemplateDeduction.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp') diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index e31c05cf2af..21f79963bd8 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -375,9 +375,11 @@ DeduceTemplateArguments(ASTContext &Context, // referred to by the reference) can be more cv-qualified than the // transformed A. if (TDF & TDF_ParamWithReferenceType) { - Qualifiers Quals = Param.getQualifiers(); - Quals.setCVRQualifiers(Quals.getCVRQualifiers() & Arg.getCVRQualifiers()); - Param = Context.getQualifiedType(Param.getUnqualifiedType(), Quals); + Qualifiers Quals; + QualType UnqualParam = Context.getUnqualifiedArrayType(Param, Quals); + Quals.setCVRQualifiers(Quals.getCVRQualifiers() & + Arg.getCVRQualifiersThroughArrayTypes()); + Param = Context.getQualifiedType(UnqualParam, Quals); } // If the parameter type is not dependent, there is nothing to deduce. -- cgit v1.2.3