<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/133089>133089</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] AllowShortFunctionsOnASingleLine=Inline does not respect macros
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rafzi
</td>
</tr>
</table>
<pre>
I stumbled upon https://github.com/llvm/llvm-project/issues/60627 which describes this same issue. Over there, the conclusion seems to be wont-fix because the intention of the related change (https://reviews.llvm.org/D117142) was to fix exactly the reported case.
However, I'd argue that a slight modification to the example is an unintended regression. If macros hide the "class" token, the scope is not correctly detected.
```
#define MY_THING(name) class name##Thing final
MY_THING(Foo)
{
int func() { return 7; }
}
```
is formatted to:
```
#define MY_THING(name) class name##Thing final
MY_THING(Foo)
{
int func()
{
return 7;
}
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVM-vozYQ_muGy-hFxoSQHDjwGtGN1HYPu5eeKv8YwK2xI9skb_vXV3ay3X1VT70UIQFm_M33zcxnEaOZHVEP7Su050psafGhD2L601TS6y_9BWPaVmlJ43b1DpeUrhGaAfgIfJxNWja5U34FPlp7-_p4uQb_O6kEfDQxbhSBjwd24B3eF6MW1BRVMJIipsVEjGIlLIE7_HijgGmhQMB_yC-ovFN2i8Y7jERrxORREt69Sy-TeUNJSmyRSqxxiVzKoX4qC4GsSKRRLcLNhMCP7xUEuhm6x11mvfNhBj6e67qr9xz4Ce-iZMtZ6E2oZL88Qa8-FFQRaQdsADZ88He6UcikL8A7jSLMWyYlEgqM1sxLwtVrMxklCsPkCxi9ifVqs34UDjdXJGjSGGgOFLPuHV4mXIUKPuJi9EMqcK6siBE4x-T_IPe1XlH5a4FzPqHyIVAhrimRSqSffOHAnjcbgDeaJuMIf_71t88fLr_8CPzoxEq5BiUJPr4a4M3nxbgZJ-OEBTZ8t2H0Hvgpw3WvwAZEzO3AaXMK-DFDQfeKgdIWHHbQvCJ05xJ-_icfNpiIkw-rSLnMyed-_V-0n4vffufrOxl59V-VVLpv9Kk5iYr6utvz06lr6rpaenaQnWz0QXeHfc0OLdOtknLfKbVvumPNKtNzxlvW8EPdtG3Ndk0rj0JLVTPZSX6sYc9oFcb-PbdVsU9fNw07niorJNlYXF2mxM0vj2oC59nnoS8uldscYc-siembA6pkki0nwruN7RkHa_390-JDGjen8gzHj274ZNxs6SfjCJrzxdncD-3pMX6B4pVUeg5vtQXb__cT5Cnu1vO_AgAA___ccXvC">