From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9848 invoked by alias); 10 Oct 2011 13:48:17 -0000 Received: (qmail 9830 invoked by uid 22791); 10 Oct 2011 13:48:16 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Oct 2011 13:48:00 +0000 From: "daniel_beichl at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/47510] DW_TAG_typedef can have children when designating a naming typedef Date: Mon, 10 Oct 2011 13:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel_beichl at gmx dot net X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00830.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510 dbeichl changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel_beichl at gmx dot | |net --- Comment #15 from dbeichl 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)))