<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98641>98641</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang rejects valid program involving explict object member function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ranaanoop
</td>
</tr>
</table>
<pre>
The following [valid](https://stackoverflow.com/questions/78739117/explicit-this-member-function-use-accepted-by-msvc-but-rejected-by-clang-and-gcc) program is rejected by clang and gcc but accepted by msvc. [Demo](https://godbolt.org/z/a3vz3TW8q)
```
#include <iostream>
struct C{
int f(this int);
};
decltype(C::f) func; //msvc accepts but clang and gcc rejects
int main()
{
func(3);
}
int func(int j)
{
std::cout << "called with: " << j << std::endl;
return 5;
}
```
For future reference, the bug was discovered [here](https://stackoverflow.com/questions/78739117/explicit-this-member-function-use-accepted-by-msvc-but-rejected-by-clang-and-gcc).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVNuOozgQ_ZripUQEdgjwwEN3snzBSPts7ALca3DGl_T2fP3KgSQzq_mAkRCYcvn4nONyCe_1tBJ1UL1DdclEDLN1nROrEKu112yw6qv7NhOO1hj7qdcJoXq_CaMVVBdgzRzC1QN_A9YD630Q8h97Izca-3mQdgHWf4_kg7arB9bXTc3bsqyB9fTv1WipQx5m7fOFloFcPsZVptw8esqFlHQNpPLhK1_8TeZDDLmjD5J7UBqxTrlYVT5JCazFq7OTEwtqj488HL7wnodiVThJiUMM-IBOswn6kFRdaLG_EzVZNVgTDtZNwPofwHrBbz_4t7-b78BaKC5QvO3vU7E_2y_jepUmKkLgZ219cCQW4H_9vMYHF2XAM9TvWwAR9RpwBNYka9JP2obv01BfXuP7W5E04etKwJpzIs3fxmRG8hL4O24ikspdtr9b8Kspm13-wWD7JhqL0Cuw5iW0fscnT9w2YQ3fGKbIi-UTY09Kw4-fgZ44PqiNuLQxJK-AnxEYk8IYUvipwwz8LUUekx-PwXMprco8jUFERyG6FatfjPvdKfXW4RhDdISORnK0SgJ2xjATDnHCT-FRaS9TWZNKhTKToz-v-g-bnEx1XLW8FRl1Zc2Kuq3KlmdzJ6qBOGtOw7FVdDw1vGjb4cTKY1tV7UnITHesYMeiLll55G3FD2XBazaeuGrVWJWDgGNBi9DmYMxtSdch095H6trmdCwzIwYy_t5JGLuTA8ZSU3Fdys-HOHk4Fkb74F8IQQdD3flejHsR4r29vC7zerPmljrPZlpAO6Q83FzDh2tZdKb7383VYY7DfhJpy_2TX51NEMD6u4J0OJuIW8f-CwAA__-bJ4-s">