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

David Abrahams dave at boost-consulting.com
Tue Jun 17 15:26:51 EDT 2003


Brad King <brad.king at kitware.com> writes:

>>   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.

I hope that this doesn't mean GCC_XML won't have any representation
for (uninstantiated) templates and their specializations per se, other
than representing specific instantiations which are classes or
functions.  

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the gccxml mailing list