From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 505D83857C4D; Thu, 7 Mar 2024 21:24:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 505D83857C4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709846648; bh=g7dHN89al0ka3oHCWaRjbf1FTZmZuEWDK/8GXXC8euA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OEXDJkmpWPV3Kpy1mO1X9bFB/3r/GOyQY8W30Zy3/9tQQu1jsMW53LZTi6AByZSIZ wnjCt7h27IlcrBUAAdVRL3f3Dr6DFrrYYQiCysk9OOAI7SZWs05ubBQ0IZ9pnJEbKM +L8DvvChWbkxNhDPI3aZlww96O9GMNyp6RyUVlJI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105512] compilation with -fmodules-ts and std=c++20 leads to segfault Date: Thu, 07 Mar 2024 21:24:06 +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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka 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=3D105512 --- Comment #4 from GCC Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:0552560f6d2eaa1ae6df5c80660b489de1d5c772 commit r14-9372-g0552560f6d2eaa1ae6df5c80660b489de1d5c772 Author: Patrick Palka Date: Thu Mar 7 16:23:22 2024 -0500 c++/modules: inline namespace abi_tag streaming [PR110730] The unreduced testcase from PR110730 crashes at runtime ultimately because we don't stream the abi_tag attribute on inline namespaces and so the filesystem::current_path() call resolves to the non-C++11 ABI version even though the C++11 ABI is active, leading to a crash when destroying the path temporary (which contains an std::string member). Similar story for the PR105512 testcase. While we do stream the DECL_ATTRIBUTES of all decls that go through the generic tree streaming routines, it seems namespaces are streamed separately from other decls and we don't use the generic routines for them. So this patch makes us stream the abi_tag manually for (inline) namespaces. PR c++/110730 PR c++/105512 gcc/cp/ChangeLog: * module.cc (module_state::write_namespaces): Stream the abi_tag attribute of an inline namespace. (module_state::read_namespaces): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/hello-2_a.C: New test. * g++.dg/modules/hello-2_b.C: New test. * g++.dg/modules/namespace-6_a.H: New test. * g++.dg/modules/namespace-6_b.C: New test. Reviewed-by: Jason Merrill =