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: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: ian at wasabisystems dot com
- Cc: drow at mvista dot com, gcc at gcc dot gnu dot org, gdr at integrable-solutions dot net
- Date: Sun, 7 Dec 2003 12:28:37 -0500 (EST)
- Subject: Re: [c++] Another question about demangler output
How to demangle "_ZN2BBcvPFivEEv"?
(1) BB::operator int (*)()()
Not legal C++. I looked at the grammar in Appendix A of TC++PL
and was surprised to learn that it is not "operator typeid ()",
but a restriction "operator blah ()" where "blah" can expand
only to certain types. But that's the way it is.
(2) BB::operator (int (*)()) ()
Not legal C++, but closer to something that could be C++.
(3) BB::operator typeof(int (*)()) ()
This is okay with me. It is still not legal C++, but it is legal
with g++ extensions. That's better than something which can't be
compiled at all.
(4) BB::operator __typeof__(int (*)()) ()
I suggest this improvement to (3). This is my favorite.
(5) _ZN2BBcvPFivEEv
Hey, it's an option, but I don't like it and I doubt that anybody
else likes it either.
My preference order is (4) > (3) > (2) > (1) > (5).
GDR is asking a slightly different question, which is how to mangle
"BB::operator __typeof__(int (*)()) ()". I don't mind mangling that as
"_ZN2BBcvPFivEEv" without the __typeof__ in the mangled name.
I don't know enough about the subtleties of templates to comment on the
cases where template arguments come into play.
Michael C