https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112820
Nathaniel Shead <nathanieloshead at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nathanieloshead at gmail dot com --- Comment #1 from Nathaniel Shead <nathanieloshead at gmail dot com> --- The issue seems to be that the same flag is used for DECL_EXTERN and TYPE_DECL_SUPPRESS_DEBUG, and the modules reading code is getting confused and thinking that TYPE_DECLs with the latter flag set means that they are actually DECL_EXTERN and thus preventing them from being emitted. The following hunk fixes this issue but it'd probably be better to clean up all handling of extern within the modules reading so that we don't lose the "suppress debug" flag entirely. diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 33fcf396875..add3fa4b945 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -5397,7 +5397,7 @@ trees_out::core_bools (tree t) DECL_NOT_REALLY_EXTERN -> base.not_really_extern == that was a lie, it is here */ - bool is_external = t->decl_common.decl_flag_1; + bool is_external = code != TYPE_DECL && t->decl_common.decl_flag_1; if (!is_external) /* decl_flag_1 is DECL_EXTERNAL. Things we emit here, might well be external from the POV of an importer. */