aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateVariadic.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-20 23:15:49 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-20 23:15:49 +0000
commit8619edd6c5636dcdde75b1151e21029e38592e2f (patch)
tree267d4f1082e3be6f495c0c9786926180d634a6cb /lib/Sema/SemaTemplateVariadic.cpp
parent6178e53c59cde02b956f86743901133d72499636 (diff)
Fix a use of uninitialized variables, found by Ted!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateVariadic.cpp')
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index 3f76d9f6e3..8f57c56383 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -532,14 +532,16 @@ bool Sema::CheckParameterPacksForExpansion(SourceLocation EllipsisLoc,
// 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 (NamedDecl *PartialPack
- = CurrentInstantiationScope->getPartiallySubstitutedPack()) {
- unsigned PartialDepth, PartialIndex;
- llvm::tie(PartialDepth, PartialIndex) = getDepthAndIndex(PartialPack);
- if (PartialDepth == Depth && PartialIndex == Index)
- RetainExpansion = true;
+ if (!IsFunctionParameterPack) {
+ if (NamedDecl *PartialPack
+ = CurrentInstantiationScope->getPartiallySubstitutedPack()){
+ unsigned PartialDepth, PartialIndex;
+ llvm::tie(PartialDepth, PartialIndex) = getDepthAndIndex(PartialPack);
+ if (PartialDepth == Depth && PartialIndex == Index)
+ RetainExpansion = true;
+ }
}
-
+
if (!NumExpansions) {
// The is the first pack we've seen for which we have an argument.
// Record it.