<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61736>61736</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-Tidy: readability-static-accessed-through-instance produces broken fixit on unnamed class
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fastasturtle
</td>
</tr>
</table>
<pre>
```
struct {
static int foo() { return 1; }
} test;
int main() {
return test.foo(); // warning: static member accessed through instance [readability-static-accessed-through-instance]
// ^~~~~
// (unnamed struct at <source>:1:1)::
}
```
https://gcc.godbolt.org/z/jb9d97r3h
Fixit tries to spell out the class name, which is obviously impossible. While `foo` can be accessed using something like `decltype(test)`, maybe it's better to disable the check altogether.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8uSqzYQ_Zpm02UXFjaYBYt5XH9BqrLWow26IySXurkTZzHfnhK240x2lxJClM7pPv3SzH6MRAMcXuHwXulFppSHs2bRLEuWQJVJ7jpAW99X_Q71C0terCB0r7d_REQWLd6ij4LnlEAdQfUFgZlkyRF30LwidO83BnTvKMQCzd3EbS_sWfv4pD8d3O0U1vZfD6tRdQJ1wk-do48jNC8PLTPNhjJqa4mZHMqU0zJO6COLjpYQDq-ZtNPGBy_XzY22eeA3d_zmgYfDQ_3N4-OBw4-vr6-vb3egjkuMeiaH92xpQWjeOC3ZEjQ_oHnZrW8J4qWsR2Luh-8pv-2TyIULdnUyWrsdkzMpyDblEdTpb1Cnn6Z3fZeb6b_Ek__LC0r2xCgJ-UIhYFoEZSK0QTNjEQvqDT8nbyf0jMn88mnhcEU_XxKzN4G2-OfkAyG0dalBW6PVEQ09k7ywjyNymkmmcgr-Y4U7skGuFwJ1XAuv-hKbesNZXw2hF1AdoyERykWi86xNoJvAiewH6iBpJJkobys3NK5vel3RsGu7vm-Ox31XTUPjWutcvz82_c5Y41zda932rTmT6treVX5QtWrqRnW7bl_vu61Rne2Ode2org_nvYN9TbP2YRvCr7mktfLMCw3trmvaKmhDgdd5USrSJ66XoFQZnzwUzsYsI8O-Dp6Fn1bES6DhLeg4bv7w7lr69HeaDy85ucUSo8npgyKe15KmiI8-W8tYLTkM_2sTL9NitjbNoE5Fz_2zueT0k6yAOq1RMKjTGuU_AQAA__9XjUmn">