summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit63dad4d83be837baff9c341e6513918a4ed9eafb (patch)
tree837120a151a6974b9c05bf6f37d3bf4e42b7295e /clang/lib
parent14cf0aba4d7ca0e24a8908a4a6a295876a83800e (diff)
downloadbcm5719-llvm-63dad4d83be837baff9c341e6513918a4ed9eafb.tar.gz
bcm5719-llvm-63dad4d83be837baff9c341e6513918a4ed9eafb.zip
Fix a use of uninitialized variables, found by Ted!
llvm-svn: 123947
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaTemplateVariadic.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaTemplateVariadic.cpp b/clang/lib/Sema/SemaTemplateVariadic.cpp
index 3f76d9f6e31..8f57c56383c 100644
--- a/clang/lib/Sema/SemaTemplateVariadic.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud