<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54366>54366</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang fails to compile calls to static consteval methods through references
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jcelerier
</td>
</tr>
</table>
<pre>
Repro:
```
struct S {
static consteval auto name() { return "foo"; }
};
void f(S& s) {
s.name();
}
```
- The same works with gcc.
- Removing the reference on the parameter does work, e.g. `void f(S s) { s.name(); }` is fine
- Calling through the typename does work, e.g. `void f(S s) { S::name(); }` is fine
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNUlGOozAMPU34sQaFBGj5yMe01RxguhcIYCCzKUFJ6Ghuv4aWdjQrrRZFDrbj957j1K79Uu84ecfkK-Mnxjdb8vta3RD93EQ4A9sd4BYC-kLU0TTQuDFEvGoLeo4ORn1BJvZMVOtxj3H2IzAhOufIMkkQu9MdZfmTh-_UV2da6AjgzEQJ4Q7zjTR9EjxLN8Afwm_2BX4NCIHK4NP53wE-TRygb5p0y7_jxV3N2EOkgx479Dg2CG5cA5P2VBvRQ-swrBhMHAHTPgWieip-yP2pcu2z5GACdGbEjfaorb2xejf3w0oWvyZcav-f67wMT77-izBplWwrWekkmmhRHa0m2k4bG4BG1rjLZCxCQ3rWwF-TpfYH14aH0scdhWT2Vg0xTmGRId5o9XS9c50SKjnWXrfthR7aBzaRXBPCjNTBW5HLskwGxQtR8F3O8z3XO17wrELUeVsLWdeC12VidY02KFYcWHFKjBJcCC4zKbI8y4uU477OOiEKyfOqzfcs53ih_tKFOHW-T7xaNdRzHyhpTYjhmdQhmH5E3PDpJQ_Oq48GLXqDPlkFq1XtH6ZH9Lw">