From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7DCA63858CD1; Wed, 10 Apr 2024 01:40:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DCA63858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712713257; bh=Ljfqr3VXmff5iVBB810K2FmhBWegKQJZihszMvb1GKE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XokRWSnHvvB7O5H6OwO5A0vPqUKzDcZxpdkxSoF99BSug0jzyixb+ytXPWaD24XYi Nr6vFCRlQMQf5j5EXl4YylcsjSt3NJZJ4/TEnJl8FVQET+G6sdvTmO4Gs95TzkC09v I1lFkapt3QPxk5Am9XkiTER6/0SC5rw728USDupE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104040] linker: when exported template class from module is used in several .cpp with same tpl arg ~ undefined reference to not default non-inline destructor Date: Wed, 10 Apr 2024 01:40:54 +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.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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=3D104040 --- Comment #1 from GCC Commits --- The master branch has been updated by Nathaniel Shead : https://gcc.gnu.org/g:0774240b4df9a9bc48ce33a9625788e402498f5a commit r14-9883-g0774240b4df9a9bc48ce33a9625788e402498f5a Author: Nathaniel Shead Date: Fri Mar 29 13:53:54 2024 +1100 c++: Keep DECL_SAVED_TREE of cdtor instantiations in modules [PR104040] A template instantiation still needs to have its DECL_SAVED_TREE so that its definition is emitted into the CMI. This way it can be emitted in the object file of any importers that use it, in case it doesn't end up getting emitted in this TU. This is true even for maybe-in-charge functions, because we don't currently stream the clones directly but instead regenerate them from this function. PR c++/104040 gcc/cp/ChangeLog: * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for all vague linkage cdtors with modules. gcc/testsuite/ChangeLog: * g++.dg/modules/pr104040_a.C: New test. * g++.dg/modules/pr104040_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill =