<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang-cl doesn't treat __declspec(nothrow) as noexcept; fails to compile"
href="https://bugs.llvm.org/show_bug.cgi?id=33235">bug 33235</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>FIXED
</td>
<td>---
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>rnk@google.com
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang-cl doesn't treat __declspec(nothrow) as noexcept; fails to compile"
href="https://bugs.llvm.org/show_bug.cgi?id=33235#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - clang-cl doesn't treat __declspec(nothrow) as noexcept; fails to compile"
href="https://bugs.llvm.org/show_bug.cgi?id=33235">bug 33235</a>
from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
<pre>I think we need to do more work here. Clang warns on this code, and rejects it
outright in C++17, when MSVC accepts:
__declspec(nothrow) void __fastcall bar();
static_assert(noexcept(bar()));
__declspec(nothrow) void __fastcall bar() noexcept;
void foo() { bar(); }
$ clang-cl -std:c++17 -c t.cpp
t.cpp(3,37): warning: exception specification in declaration does not match
previous declaration [-Wmicrosoft-exception-spec]
__declspec(nothrow) void __fastcall bar() noexcept;
^
t.cpp(1,37): note: previous declaration is here
__declspec(nothrow) void __fastcall bar();
^
t.cpp(3,37): error: conflicting types for 'bar'
__declspec(nothrow) void __fastcall bar() noexcept;
^
t.cpp(1,37): note: previous declaration is here
__declspec(nothrow) void __fastcall bar();
^
1 warning and 1 error generated.
If you remove the -std:c++17, the "conflicting types" error goes away.
It's confusing that 'noexcept(bar())' evaluates to 'true' when
__declspec(nothrow) is present, but then we complain about mismatched types and
EH specifiers.</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>