[Bug c++/106825] header unit <memory> based std::shared_ptr<...>(...) use gets: undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()', aarch64 example

markmigm at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Sep 4 17:43:48 GMT 2022


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

--- Comment #3 from Mark Millard <markmigm at gmail dot com> ---
(In reply to Mark Millard from comment #2)
. . .
> export module module_template_specialization_intf;
> 
> export template<int c> int test();
> export template<>      int test<0>() { return -1; };
> export template<>      int test<1>() { return -2; };
. . .

In case it is unclear: libstdc++ is using such specializations
that lead to the libstdc++ tied instances of such failures that
was the basis for my original submittal.

Technically libstdc++ could avoid such specializations as an
implementation technique and avoid the problem for code using
libstdc++ .

If that happened, the tiny test would still not be covered and
would become a separate issue.

I'll also report that the tiny test also fails for clang++15
(from FreeBSD's devel/llvm15 port) but libc++ does not have
the problem for the original example I submitted here. So,
apparently, libc++ avoids use of template specializations
in its implementation of the specific original example.


More information about the Gcc-bugs mailing list