On Fri, Feb 16, 2024 at 10:48:28AM -0500, Jason Merrill wrote: > On 2/16/24 04:14, Jakub Jelinek wrote: > > DWARF5 added DW_AT_export_symbols both for use on inline namespaces (where > > we emit it), but also on anonymous unions/structs (and we didn't emit that > > attribute there). > > The following patch fixes it. > > Should this involve cp_decl_dwarf_attribute like the namespace handling?
I wrote it in dwarf2out.cc because the same thing needs to be done for C and C++ (admittedly dunno if other languages have something similar). Sure, it could be done in cp_decl_dwarf_attribute too but then it has to be done in c_decl_dwarf_attribute which doesn't exist. Though, it is slightly complicated by DW_AT_export_symbols not actually going on the DW_TAG_member die but on the DW_TAG_{structure,class,union}_type which DW_TAG_member uses as its DW_AT_type. But in order to ask the langhook, we likely need to pass the FIELD_DECL and not the type... Jakub