[cxx-abi-dev] Seeking clarification about mangling nested template specializations

Mike Herrick mjh at edg.com
Mon Apr 27 11:57:42 UTC 2015


> On Apr 26, 2015, at 4:07 AM, John McCall <rjmccall at apple.com> wrote:
> 
> Here’s a concrete example using a member class template:
> 
> struct A {
>  template <unsigned I> class B {};
> };
> template <class T> void bar(T t, A::B<0> x = {}, A::B<1> y = {}) {}
> int main() { bar(0); }
> 
> A compiler which always mangles member templates as nested-names
> will mangle this as:
>  _Z3barIiEvT_N1A1BILj0EEENS2_ILj1EEE
> 
> A compiler which uses the unscoped mangling when a substitution
> already exists will mangle this as:
>  _Z3barIiEvT_N1A1BILj0EEES2_ILj1EE
> 
> Unless somebody finds a compiler that actually does the latter, I think
> this is just a specification bug and we’ve always meant the former.
> I’m in the middle of rewriting the prose in this section anyway; if nobody
> objects in the next week or so, I’ll just fix this while I’m there.

EDG gets the same mangling for this example; thanks for fixing the wording.

Mike.


More information about the cxx-abi-dev mailing list