[cxx-abi-dev] abi_tag mangling
Dmitry Polukhin
dmitry.polukhin at gmail.com
Fri Jun 17 11:37:19 UTC 2016
On Wed, Jun 15, 2016 at 12:09 AM, Jason Merrill <jason at redhat.com> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20160617/f7b7a52b/attachment.html>
More information about the cxx-abi-dev
mailing list