summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-14 17:04:44 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-14 17:04:44 +0000
commit0dca5fdb4e039d0ae341814b7e5b2043a72acec0 (patch)
tree716b3e1597625d5cb20835250654524b805b836b /clang/lib/AST/DeclTemplate.cpp
parentb1ebba9ec3d07e13227e3637948643092e8eb4ae (diff)
downloadbcm5719-llvm-0dca5fdb4e039d0ae341814b7e5b2043a72acec0.tar.gz
bcm5719-llvm-0dca5fdb4e039d0ae341814b7e5b2043a72acec0.zip
Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out parameter pack. This allows us to properly handle substitution into pack expansions that involve multiple parameter packs at different template parameter levels, even when this substitution happens one level at a time (as with partial specializations of member class templates and the signatures of member function templates). Note that the diagnostic we provide when there is an arity mismatch between an outer parameter pack and an inner parameter pack in this case isn't as clear as the normal diagnostic for an arity mismatch. However, this doesn't matter because these cases are very, very rare and (even then) only typically occur in a SFINAE context. The other kinds of pack expansions (expression, template, etc.) still need to support optional tracking of the number of expansions, and we need the moral equivalent of SubstTemplateTypeParmPackType for substituted argument packs of template template and non-type template parameters. llvm-svn: 123448
Diffstat (limited to 'clang/lib/AST/DeclTemplate.cpp')
-rw-r--r--clang/lib/AST/DeclTemplate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index 6ad62eab30f..bd91facd08f 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -319,7 +319,8 @@ ClassTemplateDecl::getInjectedClassNameSpecialization() {
if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(*Param)) {
QualType ArgType = Context.getTypeDeclType(TTP);
if (TTP->isParameterPack())
- ArgType = Context.getPackExpansionType(ArgType);
+ ArgType = Context.getPackExpansionType(ArgType,
+ llvm::Optional<unsigned>());
Arg = TemplateArgument(ArgType);
} else if (NonTypeTemplateParmDecl *NTTP =
OpenPOWER on IntegriCloud