
Aaron W. LaFramboise wrote:
a.cpp:9: internal compiler error: in write_type, at cp/mangle.c:1555
This is this bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11078
Apparently this is quite an old bug. It also appears in the latest development version of GCC as of a few days ago, so it seems as if its not fixed yet. Quite likely not to be fixed soon without someone showing some interest, or fixing it themselves.
No, the real point is that this is a defect in the Itanium C++ ABI, which does not specify a way to mangle typeof (being non-standard...) nor other complex expressions used in function signatures (like function calls or method calls within sizeof expressions). I am told that the C++ ABI committee is reluctant to update the ABI at the moment because there have been some talks in the C++ reflectors to prohibit such degenerated expressions. Of course, GCC could just emit a "sorry: cannot mangle this due to a defect in the C++ ABI" like we do for the other situations, instead of just segfaulting. I will take care of this personally. As for a workaround, the whole point is to bring the typeof() out of the function signature, so that it does not need to be mangled anymore. I see Aleksey already provided a working solution along these lines, and it looks like the best workaround to me. -- Giovanni Bajo