<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102548>102548</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Explicit Method Specialization with Constraints Fails to Compile
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jcsq6
</td>
</tr>
</table>
<pre>
Clang considers the requires clause as a part of the method signature, and naturally, you aren't able to put a requires clause on a fully specialized function. However, without the requires clause, clang considers it a different function. This makes it impossible to fully specialize methods. This also doesn't seem to be an issue when fully specializing a normal function that has a requires clause.
https://godbolt.org/z/Pqocnrafj
```
<source>:11:20: error: out-of-line definition of 'method' does not match any declaration in 'test<double>'
11 | void test<double>::method()
| ^~~~~~
<source>:7:7: note: member declaration nearly matches
7 | void method() requires(std::floating_point<T>);
| ^
1 error generated.
Compiler returned: 1
```
This code compiles on gcc.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVEFz6yYQ_jXoshOPhCxLOujg5xdPL53pTN-9s4KVRIpAAZTU79Df3gEpaZ4TxgaDd7_9vl0W9F6Nhqhj1TdWfc9wDZN13ZPwz6est_LWXTSaEYQ1XklyHsJE4Oh5VY48CI2rJ0APCAu6AHZIBjOFyUqI2BhWR4xfAI2EtEOtb_HgZldAR4bxOgD2miBYWNYA-CmANYAwrFrfwC8kFGr1kyQMqxFBWXOA3-wrvZCLsK8qTHYNXxGNf4s7PSrGk2oYyJEJHyB_TMrDjH9TslHzYr1XO8t7Krtgv3uh9hakJb9p80Rz9OoJ0IDyfiV4ncjcwygzAoKxbkb9TgTChAGmlOI7OQeWf2f5eZunEBbPyjPjV8avo5W91eFg3cj49Sfj1z-erTAOh6ePTuyU759tW168XZ0gVj6y8lwUrDzznJVnIOesiz_sGh7s8KCVIZA0KKMSSTsA4_WWBcbrJB6MDTBjEBOguYEkodFhMlcmmgfygZUXaddep5C83ngAQFEAqy_wYpWET3blmZXnt2AN4-27G0ByY9Xjv3F8Kavev5EfxXWmuSf3C0FD6PRtY09-h68T9ttI1D6SeC8P440PcmM5aItBmfGvxSoTVfxIQltWfvuC9HZUbOmGkQw5DCT3Ql_svChNDhyF1RmKIaD4upJpTpdRWEkgNlcfO2kU4pDJrpRt2WJGXVHzsqia0-mYTV2JssTqVAmBDVWy5m1b1dTUdV_zlqohUx3P-TFv8oaXRZEfDy2vi6ahnqgvT60o2DGnGZU-aP0yxwuYpRvfFTmvjk2msSft03vDuaHXrR8Y5_H5cV10eujX0bNjrpUP_n-YoIKm7vGfRSuhAvy-vTF_vnXPVrjY_XCxxgeHygQPV1Tax-7bs5etTnd3zaLCtPYHYWfGrzHcvjwszj6RCIxfE0nP-HVX8dLx_wIAAP__shaxOQ">