<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJztV0tv4zYQ_jXyZWBBL9urgw7ZGPtC2wXaQ48FRY0kFhRpkJS9-fcdkolXTpxtgKLYQ0II0nBeHA7nI6lWd3fNR3FEBW5E6LWU-iTUAEx1gfMXl0wN616biTlokcRJcZtk-yS7uX9vs_jwpHjvn8AlM2tBK8yLstpsd-_qPAskUUl5r4TfHBoFRy06aJlJindJ8UQqlAP4eiAhUTQ2hM91tVutjmis0OpZda6VdVGbpqvP4cXotp6ApNxDfrYgRYhUCJSMYqCQ7BYaT-MPdsUHeoDraUKK4zt_aerb9UxBjJaEV3z75ucRda40TQto3OiX088o5PCZKZ_X9Jqff20Xaf9fRli0Z_3XywQtU72_Z52Jh4qN3d9npXyOLio9LynrhABh_eK1QqENeGBmmP1SUk8HxsXcfVVwJmWAz2F2wWaCA7N-meQ8KcizDE6j4CNMyJQFQdW5s6C0g1ErbXwk0a9X_0VMwqWvCm5vUPtReyHUXoiSF-HjN-3Qu7zER5FmaQ6d6HsKh5JDRUtscV_F9nENg0XnKD3eUTu7IBaqo5VijiazlnhECSICgWtjkPuyuTaod3ESbrwa0AlhQJeUN2-YeZ2Y-QkA-fUO8NuBCjaUsi_igIWL8jzpWXYRG0-gEQ4Lo7uZ46Nb2IkyhAuswBkmFdgD43QoGZQ07BEfzqODETSEpAOL_JjlEeUenVFe5w0orwAoPwESy_cnquFwx3n6PzFb7OLZQTerVh-frcc7NsnIWq_XkXjPyPir-sPdSW8GH7UeiAqyBbq8iO5ckf85oOhP0bnR86vIvZFiUJQki3z2UNojBWkCmK1XW4iiQZqmV2e96pqyq8uardjsRm2aL3pUt2Wxmo1sRucO3l0spYEOsLlNqaCoI-Xx4bOmjeBv2kqoK6yd0RKxKep8sxqb3bbgZcG7rO14hVlel5td37Gy7jnveuQryegHzTbJhrBbKDxBcEF0stmv_nsEoimyIs8L6uyqssxTtil3Xd9veVVVdVvzpMpwYkKm3k-qzbAyTXDZzoMloRTW2e9C2lUo8YghYIrQCSexWe6M51sxlQnthQp-tFR-W3woqEd3-VWYSROm8Q-AQhF->52915</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ColumnLimit not honored when AlignConsecutiveDeclarations is used in clang-format 13
</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 the following and the _clang-format below,
```c++
class one1234567891012345789;
extern void bar();
extern int Op(int, int);
extern int Conversion(int, int);
const int foo12345678901234568901 = 1;
void foo() {
bar();
// comment
{
one1234567891012345789 const one();
int const otherthing = Op(foo12345678901234568901,
Conversion(foo12345678901234568901,
foo12345678901234568901));
}
}
```
Running clang-format 13 on this combines the arguments to the Conversion() call and puts them past column 100 which means it's not honoring the ColumnLimit.
```c++
class one1234567891012345789;
extern void bar();
extern int Op(int, int);
extern int Conversion(int, int);
const int foo12345678901234568901 = 1;
void foo() {
bar();
// comment
{
one1234567891012345789 const one();
int const otherthing = Op(foo12345678901234568901,
Conversion(foo12345678901234568901, foo12345678901234568901));
}
}
```
Note, clang-format 12.0.1 differs in that it honors the ColumnLimit setting, but the indentation-level is not correct in clang-format 12.0.1, with clang-format 12.0.1 we get:
```c++
class one1234567891012345789;
extern void bar();
extern int Op(int, int);
extern int Conversion(int, int);
const int foo12345678901234568901 = 1;
void foo() {
bar();
// comment
{
one1234567891012345789 const one();
int const otherthing = Op(foo12345678901234568901,
Conversion(foo12345678901234568901, foo12345678901234568901));
}
}
```
My expectation is that clang-format would honor the ColumnLimit and produce the following where the indent level is 4 spaces relative to the prior line for the Converstion() call line:
```c++
class one1234567891012345789;
extern void bar();
extern int Op(int, int);
extern int Conversion(int, int);
const int foo12345678901234568901 = 1;
void foo() {
bar();
// comment
{
one1234567891012345789 const one();
int const otherthing = Op(foo12345678901234568901,
Conversion(foo12345678901234568901, foo12345678901234568901));
}
}
```
Here's the _clang-format used in the above:
```yaml
---
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4
AlignConsecutiveDeclarations: Consecutive
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztV0tv2zAM_jXOhYjhV5r64EPbYN2GPYDtsOMg24ytQZYCSU7afz9KalOnSbtehh5awbApvkRR_CS5Vu1tdc23KMH2CGslhNpx2QGTref8bgST3Xyt9MAs1EjiKLuKklWUXNy9z5LwNFF26R7PJTNjQElMs7xYnC3PyzTxJFFRfqeENxa1hK3iLdRMR9l5lB1JubQA3zckJIrGBv85rXal5Ba14Uo-qd4oaWzQpumqfXghujNHQJSvIN1bkCIEygdKRiFQiJYTjeP4vV32gR5o1DAgxfHAn5q6djpTEKIl4Qnfrrl5BJ0TTdECatu75XQz8jl8Ysr7NT3l55_tIO3_ZYRJe9J_OU3QNNWrO9aeuK_Y0P0xSulydFDpaU5ZJwRw4xav5hKNxwPT3eiWknrKMw7m7qqiYUJ4-GxG620G2DDjlkmMg4Q0SWDX86aHAZk0wKk6lwakstArqbSLJPh16l_4wG38puD2DrXn2guh9kKUvAgf35RF5_IQH1mcxCm0fL2mcCg5VLTE5ndVbB7XMBi0ltLjHNWj9WIuW1opZmkyc4FbFMADEBqlNTaubE4N6lzsuO1PBrRD6NBG-cU7Zt4mZl4BIF9vAW82VLC-lF0ReywclOdOjaIN2DiChj8stGrHBh_dwnaUIZxgBfYwKcBsWEOHkkZBw27x_jzaaE5DCDqwyI-eHlH20RnldN6B8gaA8gqQmL4_Ug37O87x_8RosA1nB92sarV9sh5v2SACaz6fB-KSkfF3-dPeCmcG10p1RHnZBF1ORHeuwP_kUfSLt7Z3_CJwLwTvJCXJYDM6KK2QgtQezMapTUTBII7jk7OetVXelnnJZpZbgdUU5PsLHs2YYC3huVEdwu9z8-haOhu1qHprNy60UJYdHYZjHVNxUkeI7f1nTpvKH9qWqMuNGdEQscjKdDHrq_M1pmWxWOf5skkKzMslS8uEsQQTLJq0nglGP3umiha0D2QSd-BdEB0tVjNeZUmWphk5WxZ5nsZskS_b9fqsKYqirMsmKhIcGBexiyNWupvpyodUj50hoeDGmgch7S-UDEQ_HPlno-2Vrj6rXl7l2cwPXfnQ_wKtU_sF">