<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57153>57153</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Function indent regression in clang-format 14
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JohnC32
</td>
</tr>
</table>
<pre>
Given:
```c++
class Foo {
const bool _isFooBar1234;
bool isFooBar1234() const {
return _isFooBar1234;
}
};
```
and `_clang-format`
```yaml
---
BasedOnStyle: Google
IndentWidth: 4
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
AllowShortFunctionsOnASingleLine: Empty
...
```
With clang-format 13, we get:
```c++
class Foo {
const bool _isFooBar1234;
bool isFooBar1234() const {
return _isFooBar1234;
}
};
```
With clang-format 14, we get:
```c++
class Foo {
const bool _isFooBar1234;
bool isFooBar1234() const {
return _isFooBar1234;
}
};
```
Notice the function indent is wrong. Note, if you remove the `AlignConsecutiveDeclarations: Consecutive` specification, then
clang-format 14 matches clang-format 13, which may be a clue as to the source of the regression.
This may be related to https://github.com/llvm/llvm-project/issues/57150, but the _clang-format files used to reproduce
this problem are different, so I thought it would be helpful to create separate issues.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdVN9v2yAQ_mvsFxTLxnFSP_ghbZaq07Q-dNIeK4zPNhOGiB-N8t_vwGmbVN2kanuYhpCBu4-P7w7Ore6Oza14ApWUmyTfJvnzd5XPnSf0OvRo5ZJZS3Zak2R9MhFsXCvrSKu1JI_CovuamYKWy6Q8A0X33C4w9Cqh9YnigjU0A84b9RvWZL09CcbJs-NF_HlETHUETY8YgxoWvTYTc28gL_uObJKzabFYzJNrZqG7Vw_uKAFzRW61HnAWfXeqA-W-i86NwbWcrRspBnWDcQH3DlO8sRYNEyJtQJ153sdvAaUa5gSafrFB6sPDqI3becUj7l5tHoRCYV-EijI_TXt3nOFZlr0b7Lnxu3AjOc8QKcqE3pADkAHcf_VGPpSE5b-ehL9eLl-1ExyIG4H0p9dFRHznqIocjFZDRhAEITOiJ0ft8fhJP817kO0j73mVE7sHLnrBIyCQIo16yeb5XRAc-Aj23Yc6Cj4i4EhaIAwRHgdLnI6qrPYGg9J9XBkYDGBRanVRGN9GDPDEYEAyB13YPzq3D7oTusM-4Bvxbcb1hAspn56Hxd7oH8AdLoW1HixOqnVR5UFc6108-OIfRHohMRZv52MMIEPn-anGXRCDllbCRJgB0om-B4PXEAitJnfIqP0w4rU4ctBedkH3CHLfexkIuQEMgVjYh-QDmWWdIk6hKVarvFpdlfU67Zqyq8uapU44Cc3uzb2_5gstbwsk9UY2f5ajMh2bturXV1W3rjqat2VR5mXZ0xoFFpTVxRJSyVqQtkkqLDaq4DDHg_Ok2qaioTml-VVRFbSqq3VWtnTF-m6FlLymWMbLHCYmZBZ0ZNoMqWmipNYPFp1SWGdfnSz-sgHiccjPPCbbNJ_1qG5Kmsajmyj9J8DQKrw">