<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65810>65810</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang: concept checking bug in out-of-line definitions of inner class member functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
c++20,
clang:frontend,
new issue,
concepts
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidtgoldblatt
</td>
</tr>
</table>
<pre>
This code:
```
template<typename Param>
concept TrivialConcept =
requires(Param param) {
(void)param;
};
template <typename T>
struct Base {
class InnerClass;
};
template <typename T>
class Base<T>::InnerClass {
template <typename Param>
requires TrivialConcept<Param>
int func(Param param) const;
};
template <typename T>
template <typename Param>
requires TrivialConcept<Param>
int Base<T>::InnerClass::func(Param param) const {
return 0;
}
```
Works on clang-16 and gcc trunk, fails on clang trunk. I believe it should be allowed per C++20 and above.
Bisecting points to 6db007a0654e as the likely culprit (this got reverted a couple of times previously for similar issues; this one slipped past).
Tagging a few interested people from the diff and from #63782, which points to the same commit:
@alexander-shaposhnikov @erichkeane @shafik
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVM2O4zYMfhr5QiRwpMRjH3yYZBpgbz0M0LMs0TYbWXIlOdN5-0LK36RdbNsFAsX8EfnxE0kZAg0WsWW7Pdu9FXKJo_OtlmfScXBGd0bGWHROf7bvIwVQTiMTr6x8Y-XtrMrrL4sRp9nIiEwc4ueMVk4Iv0ovJyZ-uXgoZxXOEd49nUmaw1Vk4u1iB49_LOQxMF7nmzDn-7wB9rK_-gAA4_XZkWa8udjF3cZe3u7SMyr4Cuv9DilEv6gIexnwOYcyMgT4Zi36Q_p8hP2_KS6RUgYmDlktXpl4fYR-TvzdaM883nn6G5NMHG6O8AhINkK_WPVPUpWzIf58Yf8B6b8DvfgljD9g6CL_oIhnCj3GxVson0r7Xstezt-cPwVwNr25HVabCqTVMCgF0S_2xPgBeknm4XLRr-EbdGgIzwgUIYxuMRo6BGmM-0ANM3o4ML5nfM_LHFN27ozrr7n3FFBFsgPMjmwMEB1UuivLF1lWuy2CDBBHBEMnNJ-gFjN7imkCYprKwUXweEYfUYME5ZbZILgeIk0YYPZ4JrcE8wm98xBoIiM9UAgLpo6GHMRZhGBonhNmGSLjzRPGdzkMCaGEHj9SO6HHEHOBLqXrvZsySE19n-vMGsZFJV5qnvj7GEmNX0pM3iG1i3LTRPGxWLalNPintBr9KoxydmG0dHJnYNsSPanxhNJiksIoezpBoVuhG9HIAttN1Wx5WfMNL8Z2Iypd182GN7jVdc-7evvS7ORm0yVR8IJaXnJRNvmCEHxd8XqnxY6XqLuq63RKOUkya2PO09r5ocjEtdWu3pSFkR2akPcn57ktGE-1Jun26A9NtovX3jsb0eq7wSZGU9SH62VEQlLs3grfpuyrbhkC25aGQgwPPJGiwfYWHG77VY2oTunFumUAsuCWuHL9ypBF0NiTpUjOhtQnlGbsuuwmnDr0eVdke7F4044xznn--JHx40BxXLq1chPjxwTj-reavfsdVWT8eG0ufsw0_RUAAP__IeH_Ig">