This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Serious design flaw in mangling sheme.
- To: Carlo Wood <carlo at alinoe dot com>
- Subject: Re: Serious design flaw in mangling sheme.
- From: Carlo Wood <carlo at alinoe dot com>
- Date: Sat, 3 Mar 2001 05:15:54 +0100
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20010303045035.A21207@a2000.nl>
Reading it back it seemed like a pretty long story.
So I decided to make a summary for the person who will fix this.
Bug1:
A 'K' in front of (member) function pointers (and references) need
to make the pointer (reference) const, not the function:
KPF<return_type><p1><p2>...<pN>E --> <return_type> (* const)(<p1>, <p2>, ..., <pN>)
KRF<return_type><p1><p2>...<pN>E --> <return_type> (& const)(<p1>, <p2>, ..., <pN>)
KM<scopetype>F<return_type><p1><p2>...<pN>E --> <return_type> (<scopetype>::* const)(<p1>, <p2>, ..., <pN>)
or, more in general:
K<type> --> <prefix> const <postfix>
Bug2:
A possibility needs to be added to the mangling sheme to mangle
const functions, this should be done as was done in with the old
ABI by putting the qualifier in front of the 'F':
PKF<return_type><p1><p2>...<pN>E --> <return_type> (*)(<p1>, <p2>, ..., <pN>) const
RKF<return_type><p1><p2>...<pN>E --> <return_type> (&)(<p1>, <p2>, ..., <pN>) const
M<scopetype>KF<return_type><p1><p2>...<pN>E --> <return_type> (<scopetype>::*)(<p1>, <p2>, ..., <pN>) const
--
Carlo Wood <carlo@alinoe.com>