From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D3533858C20; Tue, 29 Nov 2022 08:57:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D3533858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669712229; bh=u/mhCJlO/iDCqfzCGXiOQdRlEELTXFAxvcQQqYwXrIs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qXQtR2RF+OIaB0qlIhJcUeAxFfowxeL9YJSM9RzOg1G4MIc3h2gZlR3DB4mH4KsOM ZE6uMmDRmgfKEgO89BTM72koXHO5rQwE4kRymTVZkv4oUSKmmxDZVBeTwSB79M06e+ boJcLopIaZ0evWQ6eYLzoUVKl94g6Ij6HmzAbn1U= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107906] linkage of template not taken into account Date: Tue, 29 Nov 2022 08:57:09 +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: 13.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_known_to_fail short_desc 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=3D107906 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |4.1.2 Summary|Function template |linkage of template not |specialization given weak |taken into account |rather than local symbol | --- Comment #2 from Andrew Pinski --- >specializations=20 That is not a specialization, that is an instantiation. >So it's somehow a mistake of function templates. It is not function templates which is causing the issue. Rather than it is template taking another template type which is causing issues. E.g. ``` namespace { template struct Y{}; } template class Q>=20 struct f{ f(){__builtin_printf("Hello.\n");} }; f z; ``` f's ctor is emitted as a weak symbol.=