<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113766>113766</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Weird indentation of function definition after preprocessor directives
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
LucasChollet
</td>
</tr>
</table>
<pre>
I would expect this code to be well-formatted:
```cpp
#ifdef __cplusplus
extern "C"
#endif
void f();
```
But clang-format disagrees and format it to:
```cpp
#ifdef __cplusplus
extern "C"
#endif
void
f();
```
Note that there is a related test:
https://github.com/llvm/llvm-project/blob/28a2f57c98431e71f62ce524481a1356a87b5696/clang/unittests/Format/QualifierFixerTest.cpp#L1182-L1187
---
1. I know this is probably opinionated, but do you agree this is indeed something that should be fixed?
2. I would like to help contribute and fix that issue myself? Any ideas where I should start at?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0k8-PqzYQx_8acxklgoFAOHDYH0Ja6alSpUo9Phl7CNPn2MgedpP_vgLyttue2kOlxHgM9nznOx_rlPjiiTp1elan10wvMoXYfVuMTi9TcI4kG4K9d2_wERZngW4zGQGZOIEJlkACDAQf5NxhDPGqRciq8knlryp_UnW-_8w8P1aw5NHSCN-_m9ktaf3vb-gmFD0oxBeF-Pk1ecvjHr0HtjAqPCtsVfn8jxSPcBufFwHjtL88NIHlpC-RKIH2Fh6LLCDhf9IKALDqfUT_SvUvQQhk0qu9FAk4gYZITgtZEEryqXUSmdMaYa-wv7BMy3A04aqwd-795-Mwx_AHGVHYDy4MCns8axxPjWnPVVlQU4w1GjphVZ0LXZSnWp-b4VS3tcJ-s09hv3iWNXdS2Pebbwr7XxfteGSKPd8o_kZJjqtrWH4rijMe1rH5WtnhcPgaFkd4gx8-fOwccYI5hkEP7g5hZs_BryUrfIFhEbAB7mGBrX-fG9hbIgspXEkm9pfdtzRtkA4EI99WDvs9Ia4Jd4Ad_9igncjNYIKXyMMitHPBt_0cTmkhuN4TuVGVPTz5O7AlneBj68zbz0xJdBTQoso-s11p27LVGXVFg21bF8W5zaZO53nZnPOioLqxJVYnbXJbtcY21WhzYzPuMMeqyLEu6qrG9piPmgbbYFk1LbVVraqcrprdce3qMcRLtgnsiqJs6jpzeiCXtiuM-BX7lc3Taxa7jYZhuSRV5Y6TpL9OEha3Xf-_bTy9wu_E0W4-e9HCwUMYYVy82eaWRva8TfUoFGGONMdgKKUQwXIkI_xOKVui6_4zrlt5K3GPCt87_DMAAP__qj51Hw">