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 c++/14167] Unneeded C++ types are output in debug info due to use of static constants



------- Comment #4 from drow at gcc dot gnu dot org  2006-01-21 16:37 -------
Oops, not so clear after all.

Debug information for Class1 is no longer emitted, but debug information for
Class1::var1 is still emitted.  It just doesn't trigger the output of the
containing class any more.

If I add a real use of var1:

class Class1 {
public:
  static const int var1 = 1;
  static const int var2 = var1;
};

class Class2 {
  static const int var1 = 1;
  static const int var2 = 1;
};

int main(void)
{
  return Class1::var1;
}

Still no change.  We get a declaration for var1, but no definition for it, and
not even a declaration of the containing class.  It looks like this:

 <1><244>: Abbrev Number: 5 (DW_TAG_variable)
     DW_AT_name        : var1
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3
     DW_AT_MIPS_linkage_name: _ZN6Class14var1E
     DW_AT_type        : <219>
     DW_AT_external    : 1
     DW_AT_declaration : 1
     DW_AT_const_value : 1

That's pretty useless.  It doesn't let a debugger print Class1::var1.


-- 

drow at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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