diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-10-07 09:32:45 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-10-07 09:32:45 -0400 |
commit | edbb2551d156d69a2e337dcd8daa69f2680d57ea (patch) | |
tree | 48ec6405ec2977cd89fc545c3e7681cbfe6555d3 /libcpp/include/cpplib.h | |
parent | d3e5465757c599ea64f611290b7793d3141a6b7c (diff) | |
download | gcc-edbb2551d156d69a2e337dcd8daa69f2680d57ea.zip gcc-edbb2551d156d69a2e337dcd8daa69f2680d57ea.tar.gz gcc-edbb2551d156d69a2e337dcd8daa69f2680d57ea.tar.bz2 |
c++ modules: static var in inline function [PR104433]
The below testcase fails to link with the error
undefined reference to `f()::y'
ultimately because during stream out for the static VAR_DECL y we
override DECL_EXTERNAL to true, which later during IPA confuses
symbol_table::remove_unreachable_nodes into thinking it's safe
to not emit the symbol.
The streaming code here already avoids overriding DECL_EXTERNAL for
inline vars and functions, so it seems natural to extend this to
static vars from an inline function.
PR c++/104433
gcc/cp/ChangeLog:
* module.cc (trees_out::core_bools): Don't override
DECL_EXTERNAL to true for static variables from an inline
function.
gcc/testsuite/ChangeLog:
* g++.dg/modules/static-2_a.H: New test.
* g++.dg/modules/static-2_b.C: New test.
Diffstat (limited to 'libcpp/include/cpplib.h')
0 files changed, 0 insertions, 0 deletions