<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64474>64474</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[FR] clang-format style setting for BreakAfterAttributes other than function attributes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
FalcoGer
</td>
</tr>
</table>
<pre>
## The feature
I would like a feature for clang-format to handle breaking after attributes other than those applied to function definitions. Right now there is only `BreakAfterAttributes`, which does not cover all attributes.
## Why is this important?
Right now there is no way to set the style and so clang-format will always delete the break after an attribute. For example
```c++
int main(int argc, char** argv)
{
[[unlikely]]
if (argc == 42)
{
return 1;
}
else
{
return 0;
}
}
```
will be formatted to
```c++
int main(int argc, char** argv)
{
[[unlikely]] if (argc == 42)
{
return 1;
}
else
{
return 0;
}
}
```
This is not the style I want. Additionally it causes clang-tidy to complain that the if is not aligned with the else with `readability-misleading-indentation`, so the formatting actively introduces a warning into my code even if it were the style I wanted.
## Additional Information
- https://stackoverflow.com/questions/76844253
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVU-P-jYQ_TTmMgIFGwJ7yIEtotrrTyv1PIknxF3HpvaENN--sgl_ttp7VRQRx_bMvHmeecYYzdkRVWL7LrbHBQ7c-VCd0Db-dwqL2uupElIJqeCzI2gJeQgkiqMoDrf_Dxj9YDVY80WA9x3Q-gCNRXdetj70yMAeOnTaEtSB8Mu4M2DLFACZg6kHpgieOwrAHTrgzkcCvFysIZ2M28E1bLwDTa1xJg3jCn6Zc8fg_AjJlMBE8M5OIMriPYU5pBCHRwRRFkL-BmNnmg60pwjOMzT-mnBY-4Jl9ZrjzMAf3ZQCcGcimP7iA6NjoU6vW38A5DyMOKUcInGahsiTJUCnIfrvLI0mobAjThE0WWLKBpmyO1_uCXMFJx-A_sb-Yr-dSko0P42Q7-nJs8Yx9GickPs0xHBuEh1Nh0HIg5CHNHUV8m12spvtAAByhbwPLp2zncT2KLZHeC6bFoTcJ48g1FGoI2zkw1G2fzgLxENwsBbq1f3u-PwgG-kny_k3OyieDh7Wz8GdgFdWMrt1Ls4emW-F9R_Q9r8g6zOX-a1DnkX7ASM6XsFB69yDaO0EhqHBIVKci5mNzvXe-P5i0aRuxpsT095dok3Ko2E03OWllMftS5RFINRYG2t4WvYmWkJt3HlpnCbHmALPrRx9Np5PNKtKw-ZKCZXj4PXQUASEEYNLq8axh36CxmsCupLLkBjG1Kz_TpP0TzLwTB0-3C1wwvOycQkd8yUKdRDyJOQpMjZfSWRa68dV43shT38NFLOICXnalfvNRm7VQldKv6k3XFC1Lt_Wqlxv13LRVUoXut6hKna7dbtpUMttUao91bhrlNzWC1PJQqpiX5RSqr2Sq7atlVQSa1VsS9y1YlNQj8aurL32Kx_OCxPjQFW52ew2C4s12Xi_BUKVNi3r4RzFprAmcnyasWGb74vTr1TK39Trxl2k20GkK-AnEX6V-YeqP5V3MQRbfefvbLgb6pm4hGR-LS_B_0kNC3nK2SQuc0L_BAAA__9AkRlE">