[GCC-XML] internal compiler error

Brad King brad.king at kitware.com
Fri Mar 19 08:45:18 EDT 2010

Jakub Zytka wrote:
> Hi
> I've filled a bug: http://www.itk.org/Bug/view.php?id=10440, but perhaps
> someone could give me some hint.
> I've got a code (actually, this is a simplified example):
> struct Foo {};
> struct FooContainer {};
> FooContainer* getContainer(Foo *);
> template <typename T>
> struct SelfType
> {
>     typedef T Type;
> };
> template<typename T>
> void f(T e)
> {
> typedef typename
> SelfType<typeof(*getContainer(static_cast<T*>(0)))>::Type Container;
> }
> Parsing it with gccxml yields internal compiler error. The last line of
> xml is:
> <Struct id="_97" name="SelfType<__typeof__ (*
> getContainer(static_cast<T*>(0)))>" context="_1" incomplete="1"
> It seems gccxml is unable to create mangled name for the Container type.
> If i modify gccxml to create fake mangled name, instead of exiting with
> error, the code gets parsed all right, and in the xml i got:
>   <Struct id="_97" name="SelfType<__typeof__ (*
> getContainer(static_cast<T*>(0)))>" context="_1" incomplete="1"
> mangled="SomeFakeName"
>  location="f1:7" file="f1" line="7" artificial="1" align="8"/>
> What are the possible consequences of such modification? I mean - what
> are the requirements for the mangled name? Is it enough to provide some
> bijection from the actual type to the mangled name, or does the mangled
> name have to adhere to some format and so on? I use gccxml to provide
> input to py++

The mangled name is included only because it was easy to add and
may be useful to some people.  It certainly may not match the
mangled name of the symbol that really gets built by the target
compiler.  In cases that the mangled name cannot be produced it
is safe to just leave off the mangled="" attribute completely.


More information about the gccxml mailing list