<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 --- - static const class variables in unnamed namespace have external linkage"
href="https://llvm.org/bugs/show_bug.cgi?id=30800">30800</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>static const class variables in unnamed namespace have external linkage
</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>Linux
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>timshen91@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>namespace {
struct A { static const int foo = 3; };
const int bar = 4;
}
const int &Foo() {
return A::foo;
}
const int &Bar() {
return bar;
}
In this example bar has internal linkage:
@_ZN12_GLOBAL__N_1L3barE = internal constant i32 4, align 4
but A::foo has external linkage:
@_ZN12_GLOBAL__N_11A3fooE = external constant i32, align 4
A::foo should have internal linkage and the initializer.</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>