diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-03-07 16:23:22 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-03-07 16:23:22 -0500 |
commit | 0552560f6d2eaa1ae6df5c80660b489de1d5c772 (patch) | |
tree | ede33f7b2df70be01d730a4870daa3a96f24c79d /gcc/c | |
parent | e162b2ff52c5e20f6624ff6b66845fe573cef183 (diff) | |
download | gcc-0552560f6d2eaa1ae6df5c80660b489de1d5c772.zip gcc-0552560f6d2eaa1ae6df5c80660b489de1d5c772.tar.gz gcc-0552560f6d2eaa1ae6df5c80660b489de1d5c772.tar.bz2 |
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 <jason@redhat.com>
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions