https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109887

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, simpler testcase would be
#include <type_traits>

template <class T>
std::enable_if_t <std::is_integral <T>::value, int>
foo() { return 0; }

int a = foo<int> ();

GCC mangles this as
_Z3fooIiENSt9enable_ifIXsrSt11is_integralIT_E5valueEiE4typeEv
while clang as
_Z3fooIiENSt9enable_ifIXsr3std11is_integralIT_EE5valueEiE4typeEv
but c++filt is able to demangle both as
std::enable_if<std::is_integral<int>::value, int>::type foo<int>()
So, the difference between the two is that gcc uses substitution St for std::
while clang doesn't.
In https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling sr is
<unresolved-name> ::= [gs] <base-unresolved-name>                     # x or
(with "gs") ::x
                    ::= sr <unresolved-type> <base-unresolved-name>     # T::x
/ decltype(p)::x
...
and
<unresolved-type> ::= <template-param> [ <template-args> ]            # T:: or
T<X,Y>::
                    ::= <decltype>                                      #
decltype(p)::
                    ::= <substitution>
and
<substitution> ::= St # ::std::
among other things, so I think st is what should be used instead of 3std.

Reply via email to