<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85992>85992</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Pointer to member function should reject explicit object parameter
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Rajveer100
</td>
</tr>
</table>
<pre>
Clang accepts the following invalid code:
```C++
struct S {
int f(int);
};
using T = int (S::*)(this int); // Invalid
T t = &S::f;
```
GCC corectly rejects it:
```C++
error: a pointer to member function type cannot have an explicit object parameter
4 | using T = int (S::*)(this int); // INVALID
| ^~~~~~~~
note: the type of a pointer to explicit object member function is a regular pointer to function type
```
[GodBolt](https://godbolt.org/z/jq6nKqfPx)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU8tu2zoQ_ZrRZhCDoizJWmjhx1UQ3IuLoAm6pyhKYkCTCjlyky767QVlp3kAKQqUIGiD1DlnzjxECHqwStWQ7yA_JGKm0fn6i3g4KeVTxpLWdc_13gg7oJBSTRSQRoW9M8Z903ZAbU_C6A6l6xRkW2AHYC9nwc57D3wX93IbyM-S8A6hvNwgakvYA99oS8AryC4PUB5e_y_nHKLmPUJ2WEDAN3dRNdsC30Yo39CoA_4iQgTeAG_w5hznmeYeaaEAXlzg_avQS9Rvda_3e5TOK0nmGb16UJICavojw8p75yHbosDJaUvKIzk8qmOrPPazlaSdRXqeFEphrSMcxUmhsKieJqOlJnRtVMRJeHFUpPwlb2uEco9_kZP_v27_uzm8VCGuSAj5Pz_O6_xiHcXSLoVfwnT9ey8f4_zoTQcU6NUwG-Hf4t6Z_032Id9du27nDEF-AL4Ziaaw-Is2Bte1ztDK-QF48x148_BY2H8f-9sn4FXS1VlXZZVIVJ2WKasKnq2rZKyLrOeiYxVXpejTMhVd36m0yHJRdJks80TXnPE1yzhLq7Ri1Yql5VqUcs2KrpJFmsGaqaPQZmXM6RjlEx3CrOpNXlU8MaJVJiyTxbmMEwScxyHzdfz-qp2HAGtmdKDwykCazDKOZ0R-wNvPeyaMbjbdpR8_75Zk9qb-kDNN49yupDsCb6L45edq8i6CgTeLlwC8Wez8DAAA___AokBt">