From d0e1c95dccd4944064d4abac7aa12b4bce770170 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 13 Mar 2012 07:21:50 +0000 Subject: Implement [temp.param]p5: the top-level cv-qualifiers on a non-type template parameter's declaration are ignored when determining the parameter's type. llvm-svn: 152619 --- clang/lib/Sema/SemaTemplate.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib') diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index e76a2538693..37c7cefb0da 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -643,8 +643,12 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) { T->isNullPtrType() || // If T is a dependent type, we can't do the check now, so we // assume that it is well-formed. - T->isDependentType()) - return T; + T->isDependentType()) { + // C++ [temp.param]p5: The top-level cv-qualifiers on the template-parameter + // are ignored when determining its type. + return T.getUnqualifiedType(); + } + // C++ [temp.param]p8: // // A non-type template-parameter of type "array of T" or -- cgit v1.2.3