]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/dwarf2out.c
PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
[thirdparty/gcc.git] / gcc / dwarf2out.c
index 4ea05a5b8420ac926c9000f392ce083cb3378f53..7c930746e7b384cc2700ada807dbb9397f3ed0b4 100644 (file)
@@ -17537,6 +17537,11 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
 
       TREE_ASM_WRITTEN (type) = 1;
       add_byte_size_attribute (type_die, type);
+      if (dwarf_version >= 3 || !dwarf_strict)
+       {
+         tree underlying = lang_hooks.types.enum_underlying_base_type (type);
+         add_type_attribute (type_die, underlying, 0, 0, context_die);
+       }
       if (TYPE_STUB_DECL (type) != NULL_TREE)
        {
          add_src_coords_attributes (type_die, TYPE_STUB_DECL (type));