<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/119745>119745</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
missed constraints equivalence put in a different position when defining a class function outside a class
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mrussoLuxoft
</td>
</tr>
</table>
<pre>
Here the example where the function definition uses a requires clause whereas
the function declaration uses a concept applied directly to the template parameter type:
https://godbolt.org/z/YMxbrY5rP
template<typename T>
concept C = true;
// declaration:
template<C T>
class A1{
public:
template<C Tnest>
void f();
};
//definition:
template<C T>
template<typename Tnest>
requires C<Tnest>
void A1<T>::f(){};
Standard text in [temp.constr.decl]-p3 reads that the logical AND of all constraints need to be considered.
Indeed, gcc accepts it (MVSC does not).
Note that at the referred link, there is also another example with class A2, involving a constraint that is a logical OR of two other constraint, but all compilers fails if I explicit the OR in the requires clause... which seems to be fair, isn't it ?
Really, you can simplify the example by making classes as non-template, you would get the same results: https://godbolt.org/z/PdMzqG6z5
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVE1v4zYQ_TX0ZRBBoqw4OuigOHW7QLO7yBYF9kiRI4tditSSIzvOry8oyR8Jii5gwPaQ782bmTcUIei9RaxY8ciKp5UYqXO-6v0YgvtzfHUtrRqnTtUf6BGoQ8BX0Q8G4didI-1oJWlnQWGrrZ5-jgEDCPD4c9QeA0gjxrCARGBp_QEojfDiFimdlTgQiGEwGhUo7VGSOQG5KSlhPxhBCIPwokdCD3QakOU1S-OnIxpC_Md3jO_2TjXOUOL8nvHdG-O778-vjf9e-K_z9TMdy7eRxooe4S-W_8bS-qxkCyx_AvIjsvxxRs3kt_Iv-W8ItxcmI0KAOmObiB_Gxmg5AwAA3iMsBppR8ezgtIKW8QfGyyX75umDjGv3_1fEf1Z6zXaZ2Jbl25v4pKDOYjAG8prl9VnQ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