<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 - Crash on compiling invalid requires expression"
href="https://bugs.llvm.org/show_bug.cgi?id=47582">47582</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash on compiling invalid requires expression
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>marian.darius98@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>Created <span class=""><a href="attachment.cgi?id=23984" name="attach_23984" title="Files requested by the compiler in the crash message.">attachment 23984</a> <a href="attachment.cgi?id=23984&action=edit" title="Files requested by the compiler in the crash message.">[details]</a></span>
Files requested by the compiler in the crash message.
While writing an experimental implementation of std::is_polymorphic using a
requires expression, I made a small mistake in the program. I was expecting a
compile error, but Clang crashed instead (with an assertion failure):
template<class T>
inline constexpr bool is_polymorphic = requires {
typename dynamic_cast<const volatile void*>(declval<T*>());
};
The expected output is a compile error (I strongly believe), the code is an
invalid usage of the requires { typename ... } clause.
I attached a bundle with all the files required by the crash. Since it was
fully reproducible, I minimized the example as much as I could.
"clang-crash.cpp" is the original source code, "cli-output.txt" is the console
output for running the command, and the other attachments are files requested
in the output of the compiler.</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>