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: Really obscure C++ mangling error with -fnew-abi


> This is a bit fuzzy, I think.  The spec currently says,
> 
>     All substitutions are for entities that would appear in a symbol
>     table.
> 
> That defines the mangling in implementation-specific terms, but it
> would seem to me to imply that the struct name s::m is distinct from
> the template name s::m, and therefore one cannot be substituted for
> another.  So, the next best thing (i.e. next longest prefix) is to
> substitute for the struct name s. 
> 
> Do you read it similarly?

Upon rereading it, yes. I was confused by the statement

# There are two exceptions that appear to be substitution candidates
# from the grammar, but are explicitly excluded: ...
# function and operator names other than extern "C" functions. 

The rationale for this exception was that a function name cannot
appear later in the mangling, and that it may cause confusion with
types that have the same qualifier. So I assumed the same rationale
holds for names of template functions. 

However, the exception appears to apply to the <function name> in an
<encoding> only.

Actually, does it? I assume a function name appearing in an expression
(in a template parameter) would not be substituted, either.

Regards,
Martin

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