<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 on Windows should define __STDCPP_THREADS__ to be 1"
href="https://bugs.llvm.org/show_bug.cgi?id=33230">33230</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang on Windows should define __STDCPP_THREADS__ to be 1
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</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>normal
</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>sfinae@hotmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=18541" name="attach_18541" title="Self-contained test case">attachment 18541</a> <a href="attachment.cgi?id=18541&action=edit" title="Self-contained test case">[details]</a></span>
Self-contained test case
C:\Temp>type meow.cpp
/***
N4659 19.8 [cpp.predefined]/2:
"The following macro names are conditionally defined by the implementation:
[...]
__STDCPP_THREADS__
Defined, and has the value integer literal 1, if and only if
a program can have more than one thread of execution (4.7)."
***/
#ifdef __STDCPP_THREADS__
#if __STDCPP_THREADS__ == 1
#include <stdio.h>
int main() { puts("Success!"); }
#else
#error WOOF
#endif
#else
#error BOOM
#endif
C:\Temp>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25326 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
C:\Temp>cl /EHsc /nologo /W4 meow.cpp && meow
meow.cpp
Success!
C:\Temp>clang-cl -v
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
C:\Temp>clang-cl /EHsc /nologo /W4 meow.cpp && meow
meow.cpp(17,6): error: BOOM
#error BOOM
^
1 error generated.
C:\Temp>clang-cl /EHsc /nologo /W4 /std:c++latest meow.cpp && meow
meow.cpp(17,6): error: BOOM
#error BOOM
^
1 error generated.</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>