<html>
<head>
<base href="https://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 --- - Wrong value when evaluating a shadowed global inside the namespace"
href="https://llvm.org/bugs/show_bug.cgi?id=24994">24994</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong value when evaluating a shadowed global inside the namespace
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dawn+bugzilla@burble.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>If a global identifier is over shadowed in a namespace, evaluating the global
inside the namespace returns the value of the identifier in the namespace, not
the global. See comments in the following test case. This started with lldb
r247746. (Note: test case was tested with clang based on svn 3.4, 3.6 and
trunk on OSX).
#include <stdio.h>
int make_used;
static int ScNSpacGl = 2100;
namespace NS2 {
static int ScNSpacGl = 2111;
static void NS2Func(void) {
// Set BP here, eval ::ScNSpacGl, Exp: 2100 Act: 2111
printf("eval @BP line=%d: ::ScNSpacGl = %d\n", __LINE__,
::ScNSpacGl);
make_used += ScNSpacGl;
}
}
int main(int argc, char **argv) {
NS2::NS2Func();
return make_used == 0;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>