[cfe-commits] r121940 - /cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp

Douglas Gregor dgregor at apple.com
Wed Dec 15 17:40:04 PST 2010


Author: dgregor
Date: Wed Dec 15 19:40:04 2010
New Revision: 121940

URL: http://llvm.org/viewvc/llvm-project?rev=121940&view=rev
Log:
Fix a regression I caused in r121930. It turns out that
DeclarationNameInfo instances don't always have a non-NULL
TypeSourceInfo?


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=121940&r1=121939&r2=121940&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp Wed Dec 15 19:40:04 2010
@@ -221,15 +221,19 @@
   case DeclarationName::CXXConstructorName:
   case DeclarationName::CXXDestructorName:
   case DeclarationName::CXXConversionFunctionName:
-    if (!NameInfo.getNamedTypeInfo()->getType()
-                                          ->containsUnexpandedParameterPack())
+    // FIXME: We shouldn't need this!
+    if (TypeSourceInfo *TSInfo = NameInfo.getNamedTypeInfo())
+      return DiagnoseUnexpandedParameterPack(NameInfo.getLoc(), TSInfo, UPPC);
+
+    if (!NameInfo.getName().getCXXNameType()->containsUnexpandedParameterPack())
       return false;
+
     break;
   }
 
   llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded;
   CollectUnexpandedParameterPacksVisitor(Unexpanded)
-    .TraverseTypeLoc(NameInfo.getNamedTypeInfo()->getTypeLoc());
+    .TraverseType(NameInfo.getName().getCXXNameType());
   assert(!Unexpanded.empty() && "Unable to find unexpanded parameter packs");
   DiagnoseUnexpandedParameterPacks(*this, NameInfo.getLoc(), UPPC, Unexpanded);
   return true;





More information about the cfe-commits mailing list