diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-24 00:15:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-24 00:15:10 +0000 |
commit | 56bc9832bc8f80604bfddc2c93f81537df6930a1 (patch) | |
tree | c6ff99dc08210a48fd5a3f72a309611b71837042 /lib/AST | |
parent | 10738d36b150aa65206890c1c845cdba076e4200 (diff) |
When instantiating a non-type template parameter pack, be sure to
extract the appropriate argument from the argument pack (based on the
current substitution index, of course). Simple instantiation of pack
expansions involving non-type template parameter packs now works.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 3 | ||||
-rw-r--r-- | lib/AST/StmtProfile.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 95421a494b..8941200969 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -681,6 +681,9 @@ void DeclPrinter::VisitTemplateDecl(TemplateDecl *D) { dyn_cast<NonTypeTemplateParmDecl>(Param)) { Out << NTTP->getType().getAsString(Policy); + if (NTTP->isParameterPack() && !isa<PackExpansionType>(NTTP->getType())) + Out << "..."; + if (IdentifierInfo *Name = NTTP->getIdentifier()) { Out << ' '; Out << Name->getName(); diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index 418b241009..66c067b7b1 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -894,6 +894,7 @@ void StmtProfiler::VisitDecl(Decl *D) { if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(D)) { ID.AddInteger(NTTP->getDepth()); ID.AddInteger(NTTP->getIndex()); + ID.AddInteger(NTTP->isParameterPack()); VisitType(NTTP->getType()); return; } |