<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 - Macro expansion not performed on argument to __has_cpp_attribute"
href="https://bugs.llvm.org/show_bug.cgi?id=48462">48462</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Macro expansion not performed on argument to __has_cpp_attribute
</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>Linux
</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++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ndkrempel@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>C++20 specifies that the pp-tokens given to __has_cpp_attribute are subject to
macro expansion (<a href="http://eel.is/c++draft/cpp.cond#5">http://eel.is/c++draft/cpp.cond#5</a>). GCC performs macro
expansion here, but clang does not. For example (compiled with -std=c++20):
#define X noreturn
#if !__has_cpp_attribute(X)
#error FAIL
#endif
(<a href="https://gcc.godbolt.org/z/jWG586">https://gcc.godbolt.org/z/jWG586</a>)
The above program hits the error case, whereas using "noreturn" directly
instead of "X" does not.</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>