From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29540 invoked by alias); 14 Aug 2013 00:08:56 -0000 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 Received: (qmail 29517 invoked by uid 48); 14 Aug 2013 00:08:54 -0000 From: "b.r.longbons at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/58150] New: debug info about definition of enum class not emitted if the declaration was already used in a template Date: Wed, 14 Aug 2013 00:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: b.r.longbons at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00723.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58150 Bug ID: 58150 Summary: debug info about definition of enum class not emitted if the declaration was already used in a template Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: b.r.longbons at gmail dot com Created attachment 30649 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30649&action=edit minimal testcase If an enum class has a forward declaration and it is used as a class member (functions seem to be okay), the full debuginfo is not emitted when the definition appear later in the TU. This makes debugging practically impossible. enums are unusual in that they can be fully used even when they have just a definition. Tested gcc versions: g++-4.6 (Debian 4.6.4-2) 4.6.4 g++-4.7 (Debian 4.7.3-4) 4.7.3 g++-4.8 (Debian 4.8.1-8) 4.8.1 Versions before 4.6 did not implement forward declarations of enum classes, so this bug is primordial. The relevant part of the debug information looks like: <1><34>: Abbrev Number: 3 (DW_TAG_enumeration_type) <35> DW_AT_name : (indirect string, offset: 0x84): ByteCode <39> DW_AT_enum_class : 1 <39> DW_AT_declaration : 1 <39> DW_AT_byte_size : 1 <3a> DW_AT_decl_file : 1 <3b> DW_AT_decl_line : 3 Whereas clang generates: <1><6f>: Abbrev Number: 6 (DW_TAG_enumeration_type) <70> DW_AT_type : <0x64> <74> DW_AT_enum_class : 1 <75> DW_AT_name : (indirect string, offset: 0x98): ByteCode <79> DW_AT_byte_size : 1 <7a> DW_AT_decl_file : 1 <7b> DW_AT_decl_line : 10