<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 - Constraint normalization of a parenthesized atomic constraint yields a different expression than an identical non-parenthesized atomic constraint"
href="https://bugs.llvm.org/show_bug.cgi?id=51406">51406</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Constraint normalization of a parenthesized atomic constraint yields a different expression than an identical non-parenthesized atomic constraint
</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++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>matthewjbarichello@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Affected versions:
- trunk
- 12.0.1
- 12.0.0
- 11.0.1
- 11.0.0
- 10.0.1
- 10.0.0
- 9.0.1
- 9.0.0
Driver cmdline:
Note: For versions not supporting -std=c++20, -std=c++2a was used.
clang++ -std=c++20 -Werror -Wall -pedantic
Code:
template<typename>
concept B = true;
template<typename T>
requires (B<T>)
struct A;
template<typename T>
requires B<T>
struct A {};
Error:
<source>:9:10: error: requires clause differs in template redeclaration
requires B<T>
^
<source>:5:10: note: previous template declaration is here
requires (B<T>)
^
1 error generated.
Notice that in the example the forward declaration of the template `A<T>` has a
requires clause with a parenthesized atomic constraint, `(B<T>)`, whereas the
definition of `A<T>` has the same requires clause, albeit non-parenthesized.
After constraint normalization, both requires clauses should be equivalent,
however, clang yields an error.
Notes:
- GCC does not exhibit this issue.
- MSVC has a similar issue that seems to be, incorrectly, fixed by converting
the redeclaration of `A` into a partially specialized template.</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>