https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68904
Bug ID: 68904 Summary: DWARF for class ios_base says it's a declaration Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: chihin.ko at oracle dot com Target Milestone: --- We've build the appended program with all manner of g++'s (from 3.4.3 to 5.2.0) and in all cases the DWARF information for class ios_base is "weird": < 2><0x00000601> DW_TAG_class_type DW_AT_name "ios_base" DW_AT_declaration yes(1) DW_AT_sibling <0x0000080d> BUT IT HAS THE USUAL MEMBER DEFINITIONS ETC FOLLOWING HERE! The test program has some other only-forward, empty and within-namespace definitions and for them the DWARF is as expected: class Fwd; < 1><0x000018d2> DW_TAG_class_type DW_AT_name "Fwd" DW_AT_declaration yes(1) class Foo { public: int foo; }; < 1><0x000014b6> DW_TAG_class_type DW_AT_name "Foo" DW_AT_byte_size 0x00000004 DW_AT_decl_file 0x00000001 /net/djomolungma/export/home/test/gnu/class/t.cc DW_AT_decl_line 0x00000012 DW_AT_sibling <0x000014e6> < 2><0x000014c2> DW_TAG_member ADDITIONAL MEMBER INFO class Bar { }; < 1><0x000014ec> DW_TAG_class_type DW_AT_name "Bar" DW_AT_byte_size 0x00000001 DW_AT_decl_file 0x00000001 /net/djomolungma/export/home/test/gnu/class/t.cc DW_AT_decl_line 0x00000019 something gets the compiler confused about 'ios_base' such that it emits attributes that say it's a declaration but then the compiler also outputs full member information for 'ios_base'.