<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63950>63950</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] RemoveSemicolon eats semicolon after catch benchmark
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HazardyKnusperkeks
</td>
</tr>
</table>
<pre>
``` c++
BENCHMARK("Foo") {
return 0;
};
```
with `RemoveSemicolon` eats the latter.
It's markes as `FunctionLBrace`:
```
AnnotatedTokens(L=0, P=0, T=5, C=0):
M=0 C=0 T=Unknown S=1 F=0 B=0 BK=0 P=0 Name=identifier L=9 PPK=2 FakeLParens= FakeRParens=0 II=0xdfaa560 Text='BENCHMARK'
M=0 C=0 T=Unknown S=0 F=0 B=0 BK=0 P=23 Name=l_paren L=10 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='('
M=0 C=1 T=Unknown S=0 F=0 B=0 BK=0 P=140 Name=string_literal L=15 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='"Foo"'
M=0 C=0 T=Unknown S=0 F=0 B=0 BK=0 P=43 Name=r_paren L=16 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text=')'
M=0 C=0 T=FunctionLBrace S=1 F=0 B=0 BK=1 P=23 Name=l_brace L=18 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='{'
```
But it actually is a lambda: https://github.com/catchorg/Catch2/blob/6e79e682b726f524310d55dec8ddac4e9c52fb5f/src/catch2/benchmark/catch_benchmark.hpp#L124
Of course clang-format can't know that, should we add something like a `LambdaMacro`?
@owenca or do you see any other way?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykld9v27gPwP8a5YVoIMu_4gc_NPXXWNF236LrPRe0RMe-yFIgyetyf_1BTpt12_WwQwHDkgiK_IikKPR-3BmimuVbljcrnMNgXf0J_0Knjjdm9gdye9r7VWfVsWYFP30gmdjGjzeMX27_9_nq093lww0TGyZEay0TgokKWPmiAeAozM4AZ-mLiJXN9_mr3dPyeQwDsII_0GS_0heaRmm1NdEvYfAQBgKNIZBbv-xf_teBidLDhG5PHtBHE-1sZBitud06lBQ9pJf_6PPSGBswkHq0ezKeic0tSxvOxBXcv04eWdrkcXJ1klRnY3AXJSf5ovaH2Rv7bOALS5sE2kW-Pf1vlmExCp9xIpY2oyITxn4kB9FrBff3UUtAi3u6vUcXidJmWT6clxyur-PwTfWIecHhkb4FljZMlG8yUv4GIX-PUKSviPrpEP0ufAn_j4Bv0ZYa-RUq-X2oJDsHzgc3mt2THgM51Ce4_ENw5-r9UNyyc9zc27gVH0Kr3of6sczfq7rkl5x2i_rCtvkIW7k9s_10r146xBxgDIAyzKj1EUYPCBqnTiFLL2EI4eDjZRItE-1uDMPcraWdmGglBjlYt2OivYpTwUTbadsx0RZUVlRsRFeKos9FliZc5bkiuVEKZUaVzEXf5T0TrXfy1dZigIwcYp94FT6dJevhcGAivU1EdkL_fw_Szs4TSI1md9FbN2EAiYaJMkAsBggDhtgX_GBnreCZAJUCbycKw2h2oMc9AcZ-dLuc-Q6ls0szat9GiWXcPpORCNaBsnC0M3giQHMEGwZy8IxHlrYrVaeqSitcUZ0Um6osNqLiq6HmUm1yUmqTbirqUVZp0iWc-q7qVJlRvxprwUXKy6RKBM-yYk1536uOUHVFknQdsozThKNea_11Wlu3W43ez1QXaZXzlcaOtF8eCyHehiPemLxZuTpuu-jmnWcZ16MP_ruhMAa9PDQ_bMwb-KnNn3q8Py-xD-RgSROc07Sana7_pWyi15fh4uDsnyQDE-1yFh9LJx7n7wAAAP__FIkFJQ">