]> granicus.if.org Git - clang/commitdiff
Provide better source info for template specializations with non-type arguments.
authorMatt Beaumont-Gay <matthewbg@google.com>
Tue, 22 Nov 2011 20:00:10 +0000 (20:00 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Tue, 22 Nov 2011 20:00:10 +0000 (20:00 +0000)
This fixes a crasher in tools like Include-What-You-Use which examine such
arguments. Patch from Dean Sturtevant at Google!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145077 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/TypeLoc.cpp

index 9bdea433a99234b37e272fdae9c5c244effe9e86..97b0b501aa869d27552cd4d27ec57f8984f1d1a9 100644 (file)
@@ -304,8 +304,7 @@ void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
     case TemplateArgument::Integral:
     case TemplateArgument::Pack:
     case TemplateArgument::Expression:
-      // FIXME: Can we do better for declarations and integral values?
-      ArgInfos[i] = TemplateArgumentLocInfo();
+      ArgInfos[i] = TemplateArgumentLocInfo(Args[i].getAsExpr());
       break;
       
     case TemplateArgument::Type:
@@ -334,4 +333,3 @@ void TemplateSpecializationTypeLoc::initializeArgLocs(ASTContext &Context,
     }
   }
 }
-