Author: matthewbg
Date: Tue Nov 22 14:00:10 2011
New Revision: 145077

URL: http://llvm.org/viewvc/llvm-project?rev=145077&view=rev
Log:
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!

Modified:
    cfe/trunk/lib/AST/TypeLoc.cpp

Modified: cfe/trunk/lib/AST/TypeLoc.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypeLoc.cpp?rev=145077&r1=145076&r2=145077&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypeLoc.cpp (original)
+++ cfe/trunk/lib/AST/TypeLoc.cpp Tue Nov 22 14:00:10 2011
@@ -304,8 +304,7 @@
     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 @@
     }
   }
 }
-


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to