https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118309
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:849dcb45c5a79fa29c3cf706c987157deea4ac9d commit r13-9552-g849dcb45c5a79fa29c3cf706c987157deea4ac9d Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Wed Apr 9 20:02:02 2025 +0200 d: Fix forward referenced enums missing type names in debug info [PR118309] Calling `rest_of_type_compilation' as the D types were built meant that debug info was being emitted before all forward references were resolved, resulting in DW_AT_name's to be missing. Instead, defer outputting type debug information until all modules have been parsed and generated in `d_finish_compilation'. PR d/118309 gcc/d/ChangeLog: * modules.cc: Include debug.h (d_finish_compilation): Call debug_hooks->type_decl on all TYPE_DECLs. * types.cc: Remove toplev.h include. (finish_aggregate_type): Don't call rest_of_type_compilation or rest_of_decl_compilation on type. (TypeVisitor::visit (TypeEnum *)): Likewise. gcc/testsuite/ChangeLog: * gdc.dg/debug/dwarf2/pr118309.d: New test. (cherry picked from commit cee353c2653d274768a67677c8ea37fd23422b3c)