From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA71A3858015; Fri, 26 Jan 2024 11:29:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA71A3858015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706268552; bh=m/nr3zZIbt9qoe0q7Mxok9nlYE6Q1QVCxVswTl723Zo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rKo+dj/I60Y8OyrVAhtGOXO5Ok1B83j+e0AXGYU3rGXuAAnZ8uCTwyjJQOlUDQYcO i59oQorFP0uNtfVuv2bq9cdljqCqU05X+vwWrY30hrFNFg/aj7iNto34sDTzsNAvEM 0gaXQywV51PFu9+anLki9RHW76R7jhivvm8AEIcY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112899] odr-using constexpr static data member of class exported from module results in linker error Date: Fri, 26 Jan 2024 11:29:10 +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.2.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D112899 --- Comment #3 from GCC Commits --- The master branch has been updated by Nathaniel Shead : https://gcc.gnu.org/g:a0dde47f84f17cbe7fa2fb41c14c5a2db8c4d63a commit r14-8451-ga0dde47f84f17cbe7fa2fb41c14c5a2db8c4d63a Author: Nathaniel Shead Date: Wed Jan 3 09:27:06 2024 +1100 c++: Emit definitions of ODR-used static members imported from modules [PR112899] Static data members marked 'inline' should be emitted in TUs where they are ODR-used. We need to make sure that inlines imported from modules are correctly added to the 'pending_statics' map so that they get emitted if needed, otherwise the attached testcase fails to link. PR c++/112899 gcc/cp/ChangeLog: * cp-tree.h (note_variable_template_instantiation): Rename to... (note_vague_linkage_variable): ...this. * decl2.cc (note_variable_template_instantiation): Rename to... (note_vague_linkage_variable): ...this. * pt.cc (instantiate_decl): Rename usage of above function. * module.cc (trees_in::read_var_def): Remember pending statics that we stream in. gcc/testsuite/ChangeLog: * g++.dg/modules/init-4_a.C: New test. * g++.dg/modules/init-4_b.C: New test. * g++.dg/modules/init-6_a.H: New test. * g++.dg/modules/init-6_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Patrick Palka Reviewed-by: Jason Merrill