<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 --- - clang-cl doesn't respect noinline on methods of dllimported classes" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24291&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=v0jEGpoB9IUeAXx96Nz6BpYq_tNBRm7fI06Fb5uvpI4&s=JMtak-Rds20-DB0Rjkh-fuTg61L9YDfye74Hjrbafu8&e=">24291</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-cl doesn't respect noinline on methods of dllimported classes
</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>URL</th>
<td>https://bugzilla.mozilla.org/show_bug.cgi?id=1188045
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ehsan@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>david.majnemer@gmail.com, hans@chromium.org, llvmbugs@cs.uiuc.edu, rnk@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>See the Mozilla bug, specifically this test case from
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bugzilla.mozilla.org_show-5Fbug.cgi-3Fid-3D1188045-23c5&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=v0jEGpoB9IUeAXx96Nz6BpYq_tNBRm7fI06Fb5uvpI4&s=MuY3ffmzdhjeT1B18KA-mA2wxYB3KRMad6wE2jiZ5rY&e=">https://bugzilla.mozilla.org/show_bug.cgi?id=1188045#c5</a>:
$ cat test.cpp
class __declspec(dllimport) Test
{
public:
void Hello();
__declspec(noinline) static Test* Instance()
{
static Test singleton;
return &singleton;
}
};
int main()
{
Test::Instance()->Hello();
return 0;
}
$ (cl -nologo -c -O2 test.cpp && dumpbin -all test.obj) | grep singleton
$ (clang-cl -nologo -c -O2 test.cpp && dumpbin -all test.obj) | grep singleton
00000002 DIR32 00000000 A
__imp_?singleton@?1??I
nstance@Test@@SAPAV2@XZ@4V2@A (__declspec(dllimport) class Test `public: static
class Test * __cdecl Test::Instance(void)'::`2'::singleton)
00A 00000000 UNDEF notype External |
__imp_?singleton@?1??Instance@Te
st@@SAPAV2@XZ@4V2@A (__declspec(dllimport) class Test `public: static class
Test
* __cdecl Test::Instance(void)'::`2'::singleton)</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>