[LLVMbugs] [Bug 21511] New: Spurious DWARF tag for static const member

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 6 17:52:04 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21511

            Bug ID: 21511
           Summary: Spurious DWARF tag for static const member
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

With current trunk, compiling this source:

struct X {
  static const int constant = 1;
};
//const int X::constant;
int foo() {
  return X::constant;
}

The DWARF for the struct shows up as
  DW_TAG_structure_type
    DW_TAG_member
    DW_TAG_variable

where the variable has DW_AT_specification pointing to the member,
and both the member and the variable have DW_AT_const_value = 1.

Un-comment the explicit definition and the DW_TAG_variable shows up
at the top level, where you'd expect, and without DW_AT_const_value.

I *think* omitting the explicit definition is legal C++, but the 
DW_TAG_variable being a child of DW_TAG_structure_type is just weird.

Pretty sure this started happening in the past month or so, before that
I wasn't seeing DW_TAG_variable at all.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141107/05275343/attachment.html>


More information about the llvm-bugs mailing list