]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Check DECL_NAMELESS in modified_type_die
authorTom Tromey <tromey@adacore.com>
Thu, 29 Aug 2024 19:23:18 +0000 (13:23 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 4 Sep 2024 18:37:54 +0000 (12:37 -0600)
While working on a patch to the Ada compiler, I found a spot in
dwarf2out.cc that calls add_name_attribute without respecting
DECL_NAMELESS.

gcc

* dwarf2out.cc (modified_type_die): Check DECL_NAMELESS.

gcc/dwarf2out.cc

index 89c2fd02649e52f4556ad1fc31e5c65da880d641..a7ec359bd0cfefd3e3bea0473b107a69ae70d8d3 100644 (file)
@@ -14019,6 +14019,7 @@ modified_type_die (tree type, int cv_quals, bool reverse,
               || (cv_quals == TYPE_UNQUALIFIED)))
          || (TREE_CODE (name) == TYPE_DECL
              && DECL_NAME (name)
+             && !DECL_NAMELESS (name)
              && (TREE_TYPE (name) == qualified_type
                  || (lang_hooks.types.get_debug_type
                      && (lang_hooks.types.get_debug_type (TREE_TYPE (name))