https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37590
Henning Meyer <hmeyer.eu at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hmeyer.eu at gmail dot com --- Comment #9 from Henning Meyer <hmeyer.eu at gmail dot com> --- This is is not a GCC bug, this is a display issue in readelf --debug-dump=info. This is a display issue specfic to GNU binutils. If I compile the example with GCC 15 and run it through readelf --debug-dump=info, I get <1><49f2>: Abbrev Number: 102 (DW_TAG_variable) <49f3> DW_AT_name : (string) s <49f5> DW_AT_decl_file : (data1) 1 <49f6> DW_AT_decl_line : (data1) 2 <49f7> DW_AT_decl_column : (data1) 13 <49f8> DW_AT_linkage_name: (strp) (offset: 0x5830): _Z1sB5cxx11 <49fc> DW_AT_type : (ref4) <0x315a>, string, basic_string<char, std::char_traits<char>, std::allocator<char> > DW_AT_type points to a typedef which has name string, but is a child of the namespace DIE with name std, the debug information is correct. If you use elfutils readelf instead of binutils readelf, the output is [ 49f2] variable abbrev: 102 name (string) "s" decl_file (data1) string.cpp (1) decl_line (data1) 2 decl_column (data1) 13 linkage_name (strp) "_Z1sB5cxx11" type (ref4) [ 315a] external (flag_present) yes location (exprloc) it won't show an incomplete name for the typedef.