diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2016-05-26 12:55:34 +0000 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2016-05-26 12:55:34 +0000 |
commit | eeba9e406681850ce52ca52a7d056355197ab354 (patch) | |
tree | 90c79618288e4e8350d11c58df58d899abb778db /clang/lib/Sema/SemaTemplateVariadic.cpp | |
parent | a224de06bc816812a5918c146b351c92b05d6ed8 (diff) | |
download | bcm5719-llvm-eeba9e406681850ce52ca52a7d056355197ab354.tar.gz bcm5719-llvm-eeba9e406681850ce52ca52a7d056355197ab354.zip |
Fix crash while parsing variable template with variadic template arguments
It is only a crash if the compiler optimize for this!=nullptr because
LocalInstantiationScope::getPartiallySubstitutedPack checks if 'this' is null
(This is crashing when clang is compiled with GCC6)
Differential Revision: http://reviews.llvm.org/D20511
llvm-svn: 270845
Diffstat (limited to 'clang/lib/Sema/SemaTemplateVariadic.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateVariadic.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateVariadic.cpp b/clang/lib/Sema/SemaTemplateVariadic.cpp index 52a1ad545a5..06afe87f515 100644 --- a/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -604,7 +604,7 @@ bool Sema::CheckParameterPacksForExpansion( // Template argument deduction can extend the sequence of template // arguments corresponding to a template parameter pack, even when the // sequence contains explicitly specified template arguments. - if (!IsFunctionParameterPack) { + if (!IsFunctionParameterPack && CurrentInstantiationScope) { if (NamedDecl *PartialPack = CurrentInstantiationScope->getPartiallySubstitutedPack()){ unsigned PartialDepth, PartialIndex; |