diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-13 07:21:50 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-13 07:21:50 +0000 |
commit | e37f484ab9a65ce4e5f90adcfa20add4215e0783 (patch) | |
tree | f237ca4abc197242dadacbf18a2dff9f62230985 /lib/Sema/SemaTemplate.cpp | |
parent | 7c5d28b6342229fb648aea59dc063f67ff16bc81 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index e76a253869..37c7cefb0d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/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 |