summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-13 07:21:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-13 07:21:50 +0000
commitd0e1c95dccd4944064d4abac7aa12b4bce770170 (patch)
tree7cc32c19fccbc2e50c7c853714af2cfdc399f9b0 /clang/lib
parent9479a2e35eb316515df78d5f5499803643f3894d (diff)
downloadbcm5719-llvm-d0e1c95dccd4944064d4abac7aa12b4bce770170.tar.gz
bcm5719-llvm-d0e1c95dccd4944064d4abac7aa12b4bce770170.zip
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
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp8
1 files changed, 6 insertions, 2 deletions
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
OpenPOWER on IntegriCloud