This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [c++] Another question about demangler output
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 07 Dec 2003 03:56:38 +0100
- Subject: Re: [c++] Another question about demangler output
- Organization: Integrable Solutions
- References: <20031206235918.GA32439@nevyn.them.org><m3fzfxl6q6.fsf@gossamer.airs.com>
Ian Lance Taylor <ian@wasabisystems.com> writes:
[...]
| This gives _ZN2BBcvPFivEEv which (currently) demangles as
| BB::operator int (*)()()
|
| But using a gcc extension, I can do this without a typedef:
|
| class BB { operator typeof (int(*)())(); };
| BB::operator typeof (int(*)())() { return 0; }
If you do that, then you might end up accpeting two different
declarations as same where the token-oriented scheme (ODR) would have
kept them separate. That is, you would not be able to differentiate
tu1.C:
struct B { operator typeof(int(*)())(); };
from
tu2.C:
struct B { typedef int (*foo)(); operator foo(); };
ODR says they are different.
-- Gaby