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]

Re: Serious design flaw in mangling sheme.


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>


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