This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510

dbeichl <daniel_beichl at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel_beichl at gmx dot
                   |                            |net

--- Comment #15 from dbeichl <daniel_beichl at gmx dot net> 2011-10-10 13:47:15 UTC ---
The same thing can happen for unions in c++11. Consider the following:

struct some_struct
{
  some_struct() = default;
  some_struct(int v) {}
};

typedef union {
    int x;
    some_struct y;
} a_union_t;

a_union_t z;

This creates a DW_TAG_typedef with children. I propose to extend the
candidate patch to unions:

--- gcc/dwarf2out.c 2011-09-15 12:16:36.000000000 +0200
+++ gcc/dwarf2out.c 2011-10-10 13:56:09.000000000 +0200
@@ -8106,7 +8106,7 @@
 strip_naming_typedef (tree type, dw_die_ref type_die)
 {
   if (type
-      && TREE_CODE (type) == RECORD_TYPE
+      && ( TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE )
       && type_die
       && type_die->die_tag == DW_TAG_typedef
       && is_naming_typedef_decl (TYPE_NAME (type)))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]