[c++] Another question about demangler output

Ian Lance Taylor ian@wasabisystems.com
Sun Dec 7 04:40:00 GMT 2003


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

> The point is this.  "typeof" is a GNU/C++ extension.  Its use in a
> function declaration should be mangled differently from any standard
> C++ construction.  After all, the ABI has provided hook for vendor
> extension. 

So you are arguing that this is a bug in g++.

I don't agree.  To me it seems natural that typeof should simply be
replaced by the resulting type when doing name mangling.  I don't see
why that is any different from the way that a typedef is simply
replaced by the resulting type.  The GNU typeof extension is really
just an anonymous typedef.  I see no reason to treat it differently
for name mangling purposes.

If somebody wants to change g++, then I guess any type defined by
typeof should be replaced by something like
    u LEN typeof_XXX
where LEN is the length of the following string and XXX is the mangled
form of the expression which is the argument to typeof.

Ian



More information about the Gcc mailing list