MantisBT - GCC-XML
View Issue Details
0005439GCC-XMLpublic2007-08-01 11:072015-03-26 11:59
Aron Bierbaum 
Brad King 
highminoralways
resolvedsuspended 
0005439: Explicit Member Template Instantiation
I am using gccxml on a large project and I am running into a problem where member template instantiations are not showing up in the output. Calling the template specializations does not even seem to help. I have attached a simple test case that also does not work. I am using the CVS version from February 22 2007. Does anyone have any ideas?
No tags attached.
zip value.zip (550) 1969-12-31 19:00
https://public.kitware.com/Bug/file/1086/value.zip
zip value2.zip (601) 1969-12-31 19:00
https://public.kitware.com/Bug/file/1087/value2.zip
Issue History
2008-06-04 17:36Aron BierbaumNote Added: 0012251
2008-06-04 18:33Brad KingNote Added: 0012253
2015-03-26 11:59Brad KingNote Added: 0038328
2015-03-26 11:59Brad KingStatusassigned => resolved
2015-03-26 11:59Brad KingResolutionopen => suspended

Notes
(0008323)
Brad King   
2007-08-01 11:25   
GCC-XML does not seem to be traversing the part of the GCC internal representation that references explicit member template instantiations. This is a bug but I don't know off the top of my head how to get this information.

I do not have time to investigate this in detail now but I can get you started.

Look in gccxml/GCC/gcc/cp/xml.c for the actual xml dump code. The function xml_output_record_type is dumping the outer class template instantiation. The member template instantiation does not get listed as a member even in the internal representation though.

Try this:

gccxml value.h -fxml=value.xml -fdump-translation-unit

This will produce an extra file dumped by GCC itself (with a .tu extension). Look for the "mult" identifer_node in there. From that you can trace back the connectivity of the internal representation. Then look in cp-tree.h for the macro that provides access to the information.
(0008328)
Aron Bierbaum   
2007-08-01 13:28   
You are correct that the class does not list member template instantiations as members currently. It is a slightly larger problem through, the function is never ever placed in the xml. I think that there is something different because I have a class template and a member template. If I eliminate the class template then the function atleast gets put in the xml.
(0008329)
Brad King   
2007-08-01 13:39   
I meant that the GCC internal representation does not even list them. The members list internally contains the "template_decl" representing the member template, but for some reason that declaration's list of instantiations is empty. Something strange is going on though because the connectivity seems to be there in the .tu output I mentioned.
(0012251)
Aron Bierbaum   
2008-06-04 17:36   
What is the status of this bug after the move to gcc4.2? It appears that I am seeing the same problems. I don't know if it is related or not but I now get the following output:

"sorry, unimplemented: call_expr cannot be mangled due to a defect in the C++ ABI"
(0012253)
Brad King   
2008-06-04 18:33   
I'm not surprised it hasn't changed.

I don't see the call_expr message using the value2.zip example. Can you reproduce this in a small test case? If so, please open a separate bug for it because it is a different issue.
(0038328)
Brad King   
2015-03-26 11:59   
As announced here:

 [ANNOUNCE] GCC-XML maintenance moving to Github
 http://thread.gmane.org/gmane.comp.compilers.gccxml/731 [^]
 http://public.kitware.com/pipermail/gccxml/2015-March/003206.html [^]

gccxml will no longer be developed by its original author, who will instead focus on CastXML:

 https://github.com/CastXML/CastXML#readme [^]

The original GCC-XML issue tracker is now closed. In order to facilitate ongoing maintenance by community participants, issues will now be tracked on the Github repository page:

 https://github.com/gccxml/gccxml/issues [^]