<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 - Clang-CL fails with mismatching exception spec with /std:c++latest"
href="https://bugs.llvm.org/show_bug.cgi?id=37853">37853</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang-CL fails with mismatching exception spec with /std:c++latest
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>steveire@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ C:\dev\src\llvm\build\releaseprefix\msbuild-bin\CL.exe /c "../simplemain.cpp"
simplemain.cpp
$ CL.exe /c /std:c++latest "../simplemain.cpp"
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
simplemain.cpp
$ C:\dev\src\llvm\build\releaseprefix\msbuild-bin\CL.exe /c /std:c++latest
"../simplemain.cpp"
simplemain.cpp
../simplemain.cpp(6,5): warning: exception specification in declaration does
not match previous declaration [-Wmicrosoft-exception-spec]
int foo(int) throw();
^
../simplemain.cpp(4,5): note: previous declaration is here
int foo(int);
^
../simplemain.cpp(6,5): error: conflicting types for 'foo'
int foo(int) throw();
^
../simplemain.cpp(4,5): note: previous declaration is here
int foo(int);
^
1 warning and 1 error generated.
$ type ..\simplemain.cpp
int foo(int);
int foo(int) throw();
This occurred in real code where _HAS_EXCEPTIONS was forcibly set to 0:
$ C:\dev\src\llvm\build\releaseprefix\msbuild-bin\CL.exe /c /std:c++latest
"../simplemain.cpp"
simplemain.cpp
In file included from ../simplemain.cpp:5:
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\new.h(31,42):
error: conflicting types for
'set_new_handler'
_CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler
_NewHandler) throw();
^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\new(26,30):
note: previous declaration is here
_CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler)
^
1 error generated.
$ C:\dev\src\llvm\build\releaseprefix\msbuild-bin\CL.exe /c "../simplemain.cpp"
simplemain.cpp
$ CL.exe /c /std:c++latest "../simplemain.cpp"
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
simplemain.cpp
$ type ..\simplemain.cpp
#define _HAS_EXCEPTIONS 0
#include <new>
#include <new.h></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>