]> granicus.if.org Git - clang/commitdiff
Fix a use of uninitialized variables, found by Ted!
authorDouglas Gregor <dgregor@apple.com>
Thu, 20 Jan 2011 23:15:49 +0000 (23:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 20 Jan 2011 23:15:49 +0000 (23:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123947 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateVariadic.cpp

index 3f76d9f6e31963e9a2ae1df28b571909d55b29b7..8f57c56383c7baca8d7ee8342cdca8235d35e4bb 100644 (file)
@@ -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.