<div dir="ltr"><div>Hello,<br><br>I've been looking into <a href="http://llvm.org/bugs/show_bug.cgi?id=15125">http://llvm.org/bugs/show_bug.cgi?id=15125</a> and I think I have an idea of where the problem is coming from but not how to fix it. Advice or input of any kind would be welcome.<br>
<br>At <a href="http://clang.llvm.org/doxygen/DeclarationName_8cpp_source.html#l00578">http://clang.llvm.org/doxygen/DeclarationName_8cpp_source.html#l00578</a>, the TInfo variable is always NULL in my experiments. So the code returns NameLoc (the start location) instead of the end.<br>
<br>This NULL value comes from <a href="http://clang.llvm.org/doxygen/d9/d4f/SemaDecl_8cpp_source.html#l03002">http://clang.llvm.org/doxygen/d9/d4f/SemaDecl_8cpp_source.html#l03002</a>. This code calls GetTypeFromParser with the type of the class (a RecordType). GetTypeFromPointer will then try to dyn_cast this to LocInfoType which gets NULL. That NULL eventually ends up in TInfo above.<br>
<br>At this point we have both the needed SourceLocations in Name.StartLocation and Name.EndLocation but we need a LocInfoType instead. Can I retrieve or construct one that's appropriate here? Or should the anonymous union in DeclarationNameLoc be extended to be able to hold a TInfo* and an end location when handling one of CXXConstructorName, CXXDestructorName and CXXConversionFunctionName?<br>
<br>-- <br></div>James Abbatiello<br><br></div>