[Bug c++/11078] [ABI] ICE in write_type with typeof and templates

ian at wasabisystems dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 9 13:56:00 GMT 2004


------- Additional Comments From ian at wasabisystems dot com  2004-08-09 13:55 -------
OK, if we need to be able to express typeof() when describing a return type,
then I agree that we need an extension to <type>.  I think your suggestion of
<type> ::= Y <expression> E is the best one.

The issue of <type> within <expr-primary> is for cases like c<typeof(int*)>. 
The current compiler treats that as being identical to c<int*>.  If that is
wrong, then we need to use the proposed Y <expression> E extension, and we need
to have <type> appear in an <expression>, which is currently not directly
possible.  Rather than introduce another extension, I propose mangling that as
1cIYLPi0EEE -- that is, we express (int*) as a constant of type (int*) and value
0.  I guess the drawback is that this means that c<typeof(int)> and c<typeof(0)>
might have identical manglings.  If that is not permissible, then we need
another extension, and we as well reuse 'Y', as in expression ::= Y <type>. 
Then c<typeof(int)> would be mangled as 1cIYXYiEEE.

If somebody gets a patch into the compiler, I will change the libiberty demangler.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11078



More information about the Gcc-bugs mailing list