<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107701>107701</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format doesn't remove line break after leading annotation (e.g., [[nodiscard]])
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bernardosulzbach
</td>
</tr>
</table>
<pre>
With clang-format version 18.1.8, a C++ input of
```cpp
[[nodiscard]]
std::array<float, 2> GetTargetSize() const noexcept;
```
does not get formatted to
```cpp
[[nodiscard]] std::array<float, 2> GetTargetSize() const noexcept;
```
even if the `ColumnLimit` allows for it.
This struck me as odd, and it seems to prevent clang-format from ever removing that line break once it decided to insert it, no matter how much the following function signature changes.
Is this intentional? If so, is there a way to instruct clang-format to not preserve those line breaks?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0k0GPpDYQhX-NuZQGGQNNc-AwPZOOVsotK-Vc2AU4a2xkFz2Z_fWRmZbSM8opUiQLJIz93levClOysycaRHsR7WuBOy8hDiNFj9GEtLufI-qlGIN5H_6wvIB26OenKcQVGW4Ukw0eqnNZlWehXgDhRaiLUBewftsZwiTkq5DP9-dJfiy9bfcvWffig7FJYzSifc3r2EpsRP0s6meMEd9F_TK5gJxFlKh_gV-Jv2OciX-3P0mos1A96OATgw_0l6aNRX35IvvoxQRK4APDTAwfPEwGOPwHw_A_e6UbebAT8EIgTvIluH31v9nVsjhJQOfCW8oMYLl8PPd9sQkSx13_gJUAEwRjjpi8AcuQiNYEHGCLWYI_pzvFsALdKEKkNdysn4EXZHDWE4yR8AcErylfZEhbc1QPrE8UGexB7wMcdY2whDdYd70cDFPIlvOF0-415xbKfYi8RwK9oJ8pfQL5loAzi_VMPv-PTtRX-DZBClnH5n2KBAhv-H63kbm_IHE4It8iJYo3Al5CogegJOprYYba9HWPBQ1Vp9pONU1fFctgxl6eaok4GVONrdKtadRITWXO_VTLvrCDkqqRveyqtm3aqsQOEU2nz6o90aSkaCStaF3p3G0tQ5wLm9JOQyW7TlaFw5FcOmZRqUffQqk8nXHI557GfU6ikc4mTv_cxJYdDZ9oc4t7oTr-CPARFHDKqThCk2NA7wPjEYRQZyrnMlf134dT9cUe3bAwbyk3vboKdZ0tL_tY6rAKdc2e7q-nLYY_SbNQ1wM1CXW9094G9XcAAAD__1rIbek">