<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56442>56442</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
'out-of-line definition' when defining member function enabled with concept outside class
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alemuntoni
</td>
</tr>
</table>
<pre>
When building the following code with Clang 14.0.0 (flag `-std=c++20`):
```
template<typename T>
concept MyConcept = std::is_integral<T>::value; //could be anything...
template<typename T>
class F {
public:
void foo() requires MyConcept<F>;
};
template<typename T>
void F<T>::foo() requires MyConcept<F<T>>
{
//long implementation...
}
```
I get the following error:
```
main.cpp:38: error: out-of-line definition of 'foo' does not match any declaration in 'F<T>'
main.cpp:38:12: error: out-of-line definition of 'foo' does not match any declaration in 'F<T>'
void F<T>::foo() requires MyConcept<F<T>>
^~~
main.cpp:34:7: note: member declaration nearly matches
void foo() requires MyConcept<F>;
^
```
See also https://stackoverflow.com/questions/72897153/outside-class-definition-of-member-function-enabled-with-concept?noredirect=1#comment128757341_72897153
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VMGOmzAQ_RpzsUDGJJAcOGw2G6mHnlqpx5WBAdwam7VNovx9B5Nsutttt5WqIsuMx_bMezPjqUxzLr_0oGk1SdVI3VHfA22NUuY0r2rTAD1J39N7JXCdrhKWMEr4plWioyRnsfMNyfY14TscnKGK8C3J7gjbE3adc3YZYelhGJXwQLJ7fx5BiwHoZ5I9LLu10TWMnn48318ktE-Dmzsc0j1K7aGzQuH9cC3oj0JNaHGH4A44ajOphlZAhT77HrkkSfIjpHcwKOEcPVBS7BbFOFVK1s-0KH5HIxsMlcFgIGNq4WmSFtwNN5o-BHgXG6TY3-Q_ABEcHF6QfN_d5fDD1eXuBngJjDKYR4l-YQDthZdG30KDCN9K2DJ_oB34VwUC1hr7-2wPQuqkHkc8lW1wer5DzeRj08ZKaqANtFLLGQ01LUItAtWCNgY5auPpIHzdz9nEo5geG5BTqeezz7x58bbPlP8nx_8gZ_T2kfUDKcL4idUKp2LmghBh_g8wVGBfYNQgrDovBMC9tP7X1UvpK2C_LpRPgM9OOUN770c3RyFUnvOi_maOYFssnqQ2A-qeJnAzVodywTfbIl1nKGKCnGwgDu8wvqVoztpCNG4nXQcVPptKQRPPbSqur-AP2lhokFKNi31KeIYO54pP-aZYF9kqfbz6i5oya7bZVkReegUlJvPtApnL4jR3y0WF5X8J-hULvWBZWua1kV3I0EAmmqwqX8alw8NTdQmIUsfrLx6t-Trj5wfpHAYKhXW-WvGoLwvBkETFedtmgqewqYpc1KLNm61g2ZZHSlSgXEnW2Ja5hhMNJlAm630kS844ZwXbpCzLGU_SvGXrNM15XWzFSgBZMcBqU8mMIzG2i2wZIFVT53BTSefdbRN5yU4DBHdoX0y-N7YU2GMm7Y2WUfBeBvTfAQiT8qo">