aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-16 08:56:23 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-16 08:56:23 +0000
commit781def075d4a486a5b367c6730fe77cb1f721ac1 (patch)
tree4e30f8956f85b917e2fb15533d5451c4754423b2 /lib/Sema/SemaTemplate.cpp
parent01dbb3b663d45e1a34e075ab8b96b8bec4d7d28b (diff)
Check for unexpanded parameter packs in non-type template parameter types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index a79c17cdbf..f94f34626d 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -626,12 +626,18 @@ Decl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D,
PrevDecl);
}
- T = CheckNonTypeTemplateParameterType(T, D.getIdentifierLoc());
- if (T.isNull()) {
+ if (DiagnoseUnexpandedParameterPack(D.getIdentifierLoc(), TInfo,
+ UPPC_NonTypeTemplateParameterType)) {
T = Context.IntTy; // Recover with an 'int' type.
Invalid = true;
+ } else {
+ T = CheckNonTypeTemplateParameterType(T, D.getIdentifierLoc());
+ if (T.isNull()) {
+ T = Context.IntTy; // Recover with an 'int' type.
+ Invalid = true;
+ }
}
-
+
NonTypeTemplateParmDecl *Param
= NonTypeTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(),
D.getIdentifierLoc(),