<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-overlay of <intrin.h> breaks <intrin0.h> in VS 2019 version 16.8p1"
href="https://bugs.llvm.org/show_bug.cgi?id=47099">47099</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang-overlay of <intrin.h> breaks <intrin0.h> in VS 2019 version 16.8p1
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.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>Headers
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>billy.oneal@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Previously reported by a Visual Studio customer as
<a href="https://developercommunity.visualstudio.com/content/problem/1144026/visual-studio-version-1680-preview-10-no-longer-co.html">https://developercommunity.visualstudio.com/content/problem/1144026/visual-studio-version-1680-preview-10-no-longer-co.html</a>
The standard libraries have an `<intrin0.h>` where we declare intrinsics used
by the standard library headers as a throughput optimization, because
`<intrin.h>` is *huge* and causes measurable throughput costs to `#include
<atomic>`.
As part of implementing C++20, we needed new intrinsics for `<bit>` so we moved
them from `<intrin.h>` to `<intrin0.h>`. Unfortunately, that is breaking
whatever overlay mechanism Clang on Windows uses to select its version of
`<intrin.h>` because it tries to declare `_tzcnt_u32` and `_tzcnt_u64` as
object-like macros.
We are interested in investigating a scheme whereby our official `<intrin.h>`
would do `#ifdef __clang__`, then `#include <whatever clang wants.hpp>` or
similar so that we would have a more firmly established contract for clang's
extensions rather than needing overlays and `#include_next`.
Billy ONeal
Visual C++ Libraries</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>