diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-01-20 23:15:49 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-01-20 23:15:49 +0000 |
| commit | 63dad4d83be837baff9c341e6513918a4ed9eafb (patch) | |
| tree | 837120a151a6974b9c05bf6f37d3bf4e42b7295e /clang/lib | |
| parent | 14cf0aba4d7ca0e24a8908a4a6a295876a83800e (diff) | |
| download | bcm5719-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.cpp | 16 |
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. |

