aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-25 02:14:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-25 02:14:59 +0000
commitc0536c8294fc4453f0f1d1cf24a62bfc725fd492 (patch)
tree2facdc4b4477c42d6a4d61a976cd44a3fc05b708 /lib/AST/Type.cpp
parent5d613b57972a761973861f7c38b3e6442243a6ab (diff)
Fix PR11848: decree that an alias template contains an unexpanded parameter pack
iff its substitution contains an unexpanded parameter pack. This has the effect that we now reject declarations such as this (which we used to crash when expanding): template<typename T> using Int = int; template<typename ...Ts> void f(Int<Ts> ...ints); The standard is inconsistent on how this case should be treated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 7b30c500c6..b6ce59e977 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1889,7 +1889,9 @@ TemplateSpecializationType(TemplateName T,
Canon.isNull()? T.isDependent() : Canon->isDependentType(),
Canon.isNull()? T.isDependent()
: Canon->isInstantiationDependentType(),
- false, T.containsUnexpandedParameterPack()),
+ false,
+ Canon.isNull()? T.containsUnexpandedParameterPack()
+ : Canon->containsUnexpandedParameterPack()),
Template(T), NumArgs(NumArgs) {
assert(!T.getAsDependentTemplateName() &&
"Use DependentTemplateSpecializationType for dependent template-name");
@@ -1922,7 +1924,7 @@ TemplateSpecializationType(TemplateName T,
if (Args[Arg].getKind() == TemplateArgument::Type &&
Args[Arg].getAsType()->isVariablyModifiedType())
setVariablyModified();
- if (Args[Arg].containsUnexpandedParameterPack())
+ if (Canon.isNull() && Args[Arg].containsUnexpandedParameterPack())
setContainsUnexpandedParameterPack();
new (&TemplateArgs[Arg]) TemplateArgument(Args[Arg]);