[cfe-commits] r123947 - /cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
Douglas Gregor
dgregor at apple.com
Thu Jan 20 15:15:49 PST 2011
Author: dgregor
Date: Thu Jan 20 17:15:49 2011
New Revision: 123947
URL: http://llvm.org/viewvc/llvm-project?rev=123947&view=rev
Log:
Fix a use of uninitialized variables, found by Ted!
Modified:
cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp?rev=123947&r1=123946&r2=123947&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp Thu Jan 20 17:15:49 2011
@@ -532,14 +532,16 @@
// 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.
More information about the cfe-commits
mailing list