On Wed, Jun 15, 2016 at 12:09 AM, Jason Merrill <[email protected]> wrote:

> It does seem like a bug.  For non-template member functions, since the
> signature we mangle is the fully-instantiated signature, it probably
> also makes sense to use that signature in determining tags, so that
> neither of the above functions would mention a tag:
>
> struct [[gnu::abi_tag ("foo")]] A
> {
>   template <class T> static T f();
>   template <class T> static A g();
> };
>
> template <class T> struct B
> {
>   static decltype(A::f<T>()) fa(decltype(A::f<T>()));
>   static decltype(A::f<T>()) fv();
>   static decltype(A::g<T>()) ga(decltype(A::g<T>()));
>   static decltype(A::g<T>()) gv();
> };
>
> int main()
> {
>   B<int>::fa(0);   // _ZN1BIiE2faEi
>   B<int>::fv();    // _ZN1BIiE2fvEv
>   B<int>::ga(A()); // _ZN1BIiE2gaE1AB3foo
>   B<int>::gv();    // _ZN1BIiE2gvB3fooEv
> }
>
> Thoughts?
>

IMHO, from theoretical point of view current rules are not consistent and
it would be better to don't have tag for all functions above. But it is
change in ABI (again). Current Clang implementation under review does the
same mangling as GCC so from practical stand point it would be better to
don't change it.
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev

Reply via email to