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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to