<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114538>114538</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: `ColumnLimit: 0` causes various continuation indent bugs, like chained function calls
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TheJJ
</td>
</tr>
</table>
<pre>
## config
`clang-format version 17.0.6`
```
---
BasedOnStyle: LLVM
---
Language: Cpp
UseTab: AlignWithSpaces
IndentWidth: 4
TabWidth: 4
AlignAfterOpenBracket: Align
# this causes the buggy continuation indents
ColumnLimit: 0
---
```
tabs are highlighted with `╺╴╴╴`.
## input (and expected output)
```cpp
int main() {
╺╴╴╴std::cout << "stuff"
╺╴╴╴ << a
╺╴╴╴ << " gnampf";
╺╴╴╴auto chain = a.b()
╺╴╴╴╺╴╴╴.c()
╺╴╴╴╺╴╴╴.d();
╺╴╴╴auto stuffstuff0 = stuff(blsf, eriw);
╺╴╴╴auto stuffstuff1 = stuff(blsf,
╺╴╴╴ eriw);
╺╴╴╴auto stuffstuff2 = stuff(
╺╴╴╴╺╴╴╴bla,
╺╴╴╴╺╴╴╴iee
╺╴╴╴);
╺╴╴╴auto stuffstuff3 = stuff(
╺╴╴╴╺╴╴╴bla,
╺╴╴╴╺╴╴╴iee
╺╴╴╴).trailcall();
}
```
## output after formatting
```cpp
int main() {
// bug 1: should have alignment spaces to line up <<
╺╴╴╴std::cout << "stuff"
╺╴╴╴╺╴╴╴╺╴╴╴ << a
╺╴╴╴╺╴╴╴╺╴╴╴ << " gnampf";
// bug 2: should just be continuation indent (or a new config option)
╺╴╴╴auto chain = a.b()
╺╴╴╴ .c()
╺╴╴╴ .d();
// correct
╺╴╴╴auto stuffstuff0 = stuff(blsf, eriw);
// correct
╺╴╴╴auto stuffstuff1 = stuff(blsf,
╺╴╴╴ eriw);
// correct, but needs new config item to allow the ) on the next line.
╺╴╴╴auto stuffstuff2 = stuff(
╺╴╴╴╺╴╴╴bla,
╺╴╴╴╺╴╴╴iee);
// bug 3: indent of bla/iee should be just one continuation indent, and .trailcall() should not be indented (probably bug 2)
╺╴╴╴auto stuffstuff3 = stuff(
╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴ bla,
╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴╺╴╴╴ iee)
╺╴╴╴ .trailcall();
}
```
## related
#58708 #59797 #55478
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWE1v2zgQ_TX0ZWBBIiVbPuhgO2tgiyx6aHZ7JqWRxJYmBZFKmn-_ICW3iZMWduJmi60RODT1-DgfmnmUuLWy0YgFyTYku5rxwbWmL25afPduJkx1XxDKCGVQGl3LhsRXJF6TRVwqrpt5bfo9d3CLvZVGQ7KM4mhBFvEEO4Cnv_BzPp-Pgw23WL3XH9y9QsLWcH39z19HkGuum4E34fK268bJvy3ecOGn1ko2-qN07YeOl2jHy3_qCrX7KCvXekw6zt5wcTwVVq9rh_37DvWm5-VndF9pH3lAGbhWWij5YNGCaxHE0DT3PihO6oE7770MO09mbI0a9vpa7mXgPHb-KCjjt-PCAu8RWtm0SjatwwrupGvBA_-gZJWRzfowSJ8ZLOLoyHBvu9Td4IDQnOsK8EuHpSc2g-sGR-jqyKLyEGipHey51ITmhK6ALDcT8gRLrKsIWxO2Lo3fmm0J2wKh1LqhrgmlpzPB18_Ewl-xllAKjeb7LtjANo-CdQIhH5yBsuVSA2FXwCMxBud0hlMwUflTWKuJ9YVuh9SFrzg4P6UyF8rWhG4Be3l3EfrkOfqXJP3oczED6SMDL5slofhZ3p6CkYhnEF4iQux_HqHI9Vyqkit1XFPLqx80-Kkfj50XuNceGCXUSd2c3YfpjtCdVyJIvMbY1gyqgpbfInCvYXvUDmzQRnAGlNQIQzf1wv-il18K8xItuPjeP9SSb6mhD1L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