<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63046>63046</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format 16 doesn't respect BreakAfterAttributes option for constructors
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
calcmogul
</td>
</tr>
</table>
<pre>
When the `BreakAfterAttributes` option in clang-format 16 is set to `Always`, it introduces a newline after attributes for member functions, but not for constructors. It seems like it should break after attributes for constructors as well.
Example input in a file called Test.cpp:
```cpp
class Test {
public:
[[deprecated]] Test(int);
[[deprecated("msg")]] Test(double);
[[deprecated]] void Func1();
[[deprecated("msg")]] void Func2();
};
```
Command:
```bash
clang-format --style="{BreakAfterAttributes: Always}" Test.cpp
```
Expected output:
```cpp
class Test {
public:
[[deprecated]]
Test(int);
[[deprecated("msg")]]
Test(double);
[[deprecated]]
void Func1();
[[deprecated("msg")]]
void Func2();
};
```
Actual output:
```cpp
class Test {
public:
[[deprecated]] Test(int);
[[deprecated("msg")]] Test(double);
[[deprecated]]
void Func1();
[[deprecated("msg")]]
void Func2();
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VcuO2zgQ_Brq0rAhUQ9bBx3sOAb2vsCe-Whb3FCkQDYzmb9fUPFjdsbJzgYZQJAEsquqWd0kRYzm7BAH1u5ZeyhEotGHQQmrJn9OtpBePw9_jeiARgTWlfuA4svuRBh2RMHIRBhZV4KfyXgHxoGywp1XJx8mQVB1YCJEJCCf4Tv7JJ4zgPFPYAiMo-B1UhhBgMMnaxyCyPQgbvxw8gEmnCQGOCWnslLMBDIROE_LvPIuUkiKfIhr-IMgIk4RrPmCWSiOPlkNMqf_WOAlAYgIT2jtmpUHVu6-vz9_E9NsEYybU84cBJyMRVDCWtTwJ0Zaq3lm9SU-r3J58uAyoqyIcQkEttl_H5uTtEbdQABLKfYa54BKEGrWHlh7WFCMb40jxntW719m9hbDt4zzKZ4Z5zn8XxTaJ2nxAcuPpL96o-GYnKoW3nfgHsrfaPhrms3h_n817aXCJz9Nwum3zkoRx5u1965brSI9W2T1ISew2T9s2noHl27c5LB7_X6cx-dvMypCDT7RnOhjKn2Z_Wm93-f4Nfi_6v7TPH5T9d-w_e8m2ClKwn6o9b_D9F_dZe-1-wPdLvRQ677uRYFD1W3btm82HS_GASWqWvSN5gpPuuqwqlrZcKwU59WmEYUZeMnrsiursmm6kq-7vt1uZa87raXses6aEidh7Nrar9Pah3NhYkw4dHXZdIUVEm28XkJhyEErmc6RNaU1keIdRoYsDq_vGO0xOsY3BAFj3qPwaMtfL6nXp32Rgh1GojkfCowfGT-eDY1JrpWfGD9m8ctnNQf_Nypi_LgsIDJ-XNbwTwAAAP__VdkbNQ">