From: Matt Beaumont-Gay Date: Tue, 22 Nov 2011 20:00:10 +0000 (+0000) Subject: Provide better source info for template specializations with non-type arguments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e855657867e95c8302f55de3f63409f9b1927c3;p=clang Provide better source info for template specializations with non-type arguments. 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 --- diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index 9bdea433a9..97b0b501aa 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -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, } } } -