[cfe-dev] -ast-print-xml hasUninstantiatedDefaultArg assert

Douglas Gregor dgregor at apple.com
Tue Nov 2 10:38:53 PDT 2010


On Nov 1, 2010, at 4:28 PM, Garrison Venn wrote:

> Well, it looks like I need more hand holding. While at frame 6 in gdb, executing:
> 
> print (argDecl->Loc).dump((argDecl->getASTContext()).getSourceManager())
> 
> gives: /usr/include/c++/4.2.1/bits/basic_string.h:254:36
> 
> Looking at the source code for SourceLocation::print(...), it looks like the above
> should be interpreted as the filename:line#:col#. However the source line: 
> <space+>_CharT* neither has a 36th column nor is a method decl
> containing a param with a default arg. So I think I'm in never never land. Is this
> because the use of getPresumedLoc(...) in the implementation of SourceLocation::
> print(...) is not returning the correct location? Or is it because _CharT type is a 
> template arg, and somehow that involves method instantiations behind the 
> scene? Or is it ...? :-)

Template instantiation may have lost some source-location information. More debugging would be needed to figure that out.

> I think the real request is that I need more pointers if you have time. I do not believe 
> the doc covers this kind of debugging for clang, but I've not been thorough, and 
> regardless I believe we have an -ast-print-xml bug. If you agree, I'll file it, though
> I was really hoping for better understanding of how parts of clang work. 


The XML printer probably isn't checking whether it should treat the default argument as an uninstantiated default argument; see the ParmVarDecl class for more information. 

	- Doug



More information about the cfe-dev mailing list