Issue 161118.1: DW_TAG for C++ static data members
Section 4.1, pg 98
DWARF 3 changed the TAG for in-class declarations of C++ static data members
to be DW_TAG_member; previously the TAG was unspecified. I think this was a
mistake, since outside of C++ terminology they are better referred to as
member variables, and so DW_TAG_variable is more appropriate. The
specification of DW_TAG_member is all about fields in a structure, and is
mostly inappropriate for variables.
This has mostly been an odd wart on the standard when we could assume that
there would be a separate DW_TAG_variable for the out-of-class definition
of the static data member, but with C++17 inline variables there doesn't
need to be an out-of-class definition, so we can end up with a member
variable for which there is no DW_TAG_variable.
Brock Wyma concurs, also pointing out that:
* Static member variables can have a DW_AT_const_value but that isn't
even a valid attribute for DW_TAG_member according to Appendix A in our
* Members typically have a data member location or data bit offset, but
static member variables do not.
Before DWARF 3, GCC used DW_TAG_variable consistently for C++ static data
members. Can we switch to specifying that, or at least allow it?
12/06/2016 -- Accepted. C++ static data represented by DW_TAG_variable.