This is the mail archive of the gcc@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]

Re: [c++] Another question about demangler output


Daniel Jacobowitz <drow@mvista.com> writes:

| One symbol generated by this program is _ZN2BBIiEcvPFivEEv, which demangles
| as:
|   BB<int>::operator int (*)()()
| 
| But that output is quite annoying for me, because it's nothing like legal
| C++, as far as I have been able to tell.

Yep, that is not valid C++.

[...]

| same time we _can't_ differentiate between them.  I've found no reasonable
| way for it to figure out what "A::operator int (*)()()" means.

It is not C++.  You have to go  through a type-alias indirection.

| Am I right that this can't be expressed in C++ without using an intermediate
| type?  If I am right, I'm not sure what to do.  If I'm wrong, we can correct
| the demangler.

I think the ABI rules for mangling and demangling is too
schizophrenic.  At one point, it is token-oriented and at another
point it is not.  Another level of difficulty is that typedef-name have
no linkage.  Did they have internal/external, I would say just go with
the intermediate type-alias name; but you can't :-(

-- Gaby


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