[GCC-XML] Instantiated template was not dumped

Brad King brad.king at kitware.com
Mon May 15 13:40:58 EDT 2006


Roman Yakovenko wrote:
> I thought,  that gccxml xml treats next case, but I was wrong.
> 
> template< class T1 >
> struct item{
>    template< class T2>
>    T2 operator()(T2 t2){ return t2; }
> };
> 
> void do_nothing(){
>    item<int> x;
>    x.operator()( double( 3.4 ) );
> }
> 
> The problem is that gccxml does not dump operator() declaration.

This is due to the way GCC's parser represents things.  While the 
operator instantiation lists the item instantiation as its context, the 
list of members of item does not contain the operator instantiation. 
Unless something directly references the instantiated declaration then 
gccxml will not encounter it in its walk of the declaration reference 
graph.  This is a known limitation.

Some such cases (including this one) may be fixed if template support 
were implemented.  There should be a reference from the item template to 
the operator member template, and then the operator template would 
reference its list of instantiations.  Unfortunately I have no time to 
do it :(

-Brad



More information about the gccxml mailing list