diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-02 02:04:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-02 02:04:06 +0000 |
commit | c52264e71931352cc1e87130713b4a4bc6872a03 (patch) | |
tree | 0a7b6a916c8d722c228eccfca299ff13c420b551 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 48af8923c5ba38023a2aec5f7924f6fbd4552b9f (diff) | |
download | bcm5719-llvm-c52264e71931352cc1e87130713b4a4bc6872a03.tar.gz bcm5719-llvm-c52264e71931352cc1e87130713b4a4bc6872a03.zip |
When we're substituting into a parameter-type-list nested inside the pattern
of an expansion, and we have a paramameter that is not a parameter
pack, don't suppress substitution of parameter packs within this
context.
llvm-svn: 126819
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index c0f130da88a..fa69e70d284 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -1510,6 +1510,7 @@ Sema::SubstBaseSpecifiers(CXXRecordDecl *Instantiation, } SourceLocation EllipsisLoc; + TypeSourceInfo *BaseTypeLoc; if (Base->isPackExpansion()) { // This is a pack expansion. See whether we should expand it now, or // wait until later. @@ -1560,13 +1561,18 @@ Sema::SubstBaseSpecifiers(CXXRecordDecl *Instantiation, // The resulting base specifier will (still) be a pack expansion. EllipsisLoc = Base->getEllipsisLoc(); + Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(*this, -1); + BaseTypeLoc = SubstType(Base->getTypeSourceInfo(), + TemplateArgs, + Base->getSourceRange().getBegin(), + DeclarationName()); + } else { + BaseTypeLoc = SubstType(Base->getTypeSourceInfo(), + TemplateArgs, + Base->getSourceRange().getBegin(), + DeclarationName()); } - Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(*this, -1); - TypeSourceInfo *BaseTypeLoc = SubstType(Base->getTypeSourceInfo(), - TemplateArgs, - Base->getSourceRange().getBegin(), - DeclarationName()); if (!BaseTypeLoc) { Invalid = true; continue; |