<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Spurious DWARF tag for static const member"
href="http://llvm.org/bugs/show_bug.cgi?id=21511">21511</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Spurious DWARF tag for static const member
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>paul_robinson@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>