<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - The linkage changes in r359260 break MIDL code"
href="https://bugs.llvm.org/show_bug.cgi?id=41817">41817</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>The linkage changes in r359260 break MIDL code
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dmajor@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The following code builds successfully with r359259 but not r359260:
$ cat a.cpp
extern const int x;
static const int x = 3;
const int* foo() { return &x; }
$ cat b.cpp
extern const int x;
static const int x = 7;
const int* bar() { return &x; }
$ cat c.cpp
const int* foo();
const int* bar();
int main(int argc, char**) { return argc ? *foo() : *bar(); }
$ clang-cl -c a.cpp b.cpp c.cpp
$ lld-link -nodefaultlib -entry:main a.obj b.obj c.obj
lld-link: error: duplicate symbol: int const x in a.obj and in b.obj
This pattern can be seen in code generated by MIDL, e.g.
<a href="https://searchfox.org/mozilla-central/search?q=text%3AHandlerData__MIDL_ProcFormatString">https://searchfox.org/mozilla-central/search?q=text%3AHandlerData__MIDL_ProcFormatString</a>
Since there are no templates involved here, I'm guessing this change in
behavior was unintended?</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>