[GCC-XML]Producing "_0" ids when parsing <string>

Brad King brad.king at kitware.com
Tue Jun 17 14:23:12 EDT 2003


>   I don't see an easy way to distinguish between the instantiated ones
> from the uninstantiated one. The only way is by inspecting all members
> and look for references to id's "_0". I have noticed in some cases the
> attribute "incomplete" was set but not in this one. Any suggestion?

I just took the time to track this problem down.  It turns out that these
nodes are created in the following situation:

template <typename T1> struct A;
template <typename T2, typename T3 = A<T2> > struct B;

GCC internally creates an "artificial" instantiation of A called A<T2>.
This instantiation looks normal to the GCC-XML extension, so it gets
dumped.  This creates the _0 references because the artifical
instantiation references other templates that are not instantiated.  I've
now added a check for artificial instantiations to prevent them from being
dumped.

This bug has now been fixed in the CVS version of GCC-XML.  If you
download it and build gccxml_cc1plus yourself, the problem should go away.

-Brad




More information about the gccxml mailing list