diff options
| author | Jason Merrill <jason@redhat.com> | 2026-01-28 14:17:13 +0800 |
|---|---|---|
| committer | Jason Merrill <jason@redhat.com> | 2026-01-31 10:16:08 +0800 |
| commit | 35b17c7713d4bd7a675ee8908724325e957d1482 (patch) | |
| tree | e1095ec87041480b336792908e32d7b6c0e5d43f /libjava/classpath/resource/gnu/java/util | |
| parent | bdd45f4eee50957091c8ca8cc275ee75a7d73038 (diff) | |
| download | gcc-35b17c7713d4bd7a675ee8908724325e957d1482.zip gcc-35b17c7713d4bd7a675ee8908724325e957d1482.tar.gz gcc-35b17c7713d4bd7a675ee8908724325e957d1482.tar.bz2 | |
c++: defer DECL_ONE_ONLY vs consteval-only [PR122785]
The failure in the given PR occurs because when setting up an
imported vague-linkage variable, we currently call 'maybe_commonize_var'
which for -freflection checks 'consteval_only_p'. Unfortunately this
latter function needs to call 'complete_type_p' which can perform
recursive loading of the (possibly yet-to-be-streamed) class type,
breaking modules assumptions.
If we just remove the consteval_only_p early exit from maybe_commonize_var,
we end up crashing at EOF while trying to mangle its comdat group, so we
need to undo maybe_commonize_var along with setting DECL_EXTERN.
PR c++/122785
gcc/cp/ChangeLog:
* decl.cc (maybe_commonize_var): Don't check consteval_only_p.
(make_rtl_for_nonlocal_decl): Undo make_decl_one_only for
consteval-only variables.
gcc/testsuite/ChangeLog:
* g++.dg/modules/reflect-1_a.H: New test.
* g++.dg/modules/reflect-1_b.C: New test.
Co-authored-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'libjava/classpath/resource/gnu/java/util')
0 files changed, 0 insertions, 0 deletions
