From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6CF293858D32; Sun, 4 Sep 2022 17:43:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CF293858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662313428; bh=vrvRgvKJ5acii5esDVaNXrhnRluSBRHb3jNn2ujbVkI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bIQbnH3vm/nR10LI+QnpN8E8RB/3N2+DwCHULd6HYBlJvgKILMdjwCgwe+DNifTZc CtEuvqskBkcasC9t6r2gLI/ocnJrS1EdfeRD4AvgEoAvf7PbdY/daKfZJpNMYhMlKy 008I6NnQ9Lbns5ScHoCxsBlIa0orb7no04nP8xgg= From: "markmigm at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106825] header unit based std::shared_ptr<...>(...) use gets: undefined reference to `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()', aarch64 example Date: Sun, 04 Sep 2022 17:43:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markmigm at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106825 --- Comment #3 from Mark Millard --- (In reply to Mark Millard from comment #2) . . . > export module module_template_specialization_intf; >=20 > export template 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.=