This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]