This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Really obscure C++ mangling error with -fnew-abi
"Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> writes:
Martin> I was confused by the statement
spec> There are two exceptions that appear to be substitution
spec> candidates from the grammar, but are explicitly excluded:
spec> ... function and operator names other than extern "C"
spec> functions.
I think that comment is simply out-of-date. It should be removed.
Martin> The rationale for this exception was that a function name
Martin> cannot appear later in the mangling, and that it may cause
Martin> confusion with types that have the same qualifier. So I
Martin> assumed the same rationale holds for names of template
Martin> functions.
The function name can appear later in the mangling, for instance in a
template argument, as you point out. But the name of the function is
not enough to meet the `entities that would appear in a symbol table'
test. I think that the name of a template is (since you can't
overload based on template arguments... phew!).
Martin> However, the exception appears to apply to the
Martin> <function name> in an <encoding> only.
The grammar in the spec as currently posted is out-of-date too.
Changes were accepted at last week's meeting that haven't made their
way into the document yet. These changes reflect a different grammar,
as it is implemented in g++. If you want to see them right away, the
grammar is documented in comments in cp-demangle.c.
Regards
Alex Samuel
CodeSourcery LLC