<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/141575>141575</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Lambda hanging indent increased by moving to a new line
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rmarker
</td>
</tr>
</table>
<pre>
There is behaviour to minimise the hanging indent with lambdas by moving them to a new line.
However, this can inadvertently increase the amount of hanging indent in particular circumstances.
For example, the following code with `-style="{BreakBeforeBraces: Allman, AllowShortLambdasOnASingleLine: false, ContinuationIndentWidth: 8}"`
```cpp
if (
[]()
{
return true;
}())
{
}
fun(
[]()
{
return 17;
});
```
Expected:
```cpp
if ([]()
{
return true;
}())
{
}
fun([]()
{
return 17;
});
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyck0uPmzAQxz-NuViJwLzCgQPZNGqllXrYSj0bGGC6fkT2kGy-fWVI231WVS0kxHhmfvPH_kvvcTQANcv3LD9EcqbJutpp6R7BRa3tr_W3CRxw9LyFSZ7Rzo6T5RoNavTAaQI-STOiGTmaHgzxC9LEldRtLz1vr1zbc9ilCXQoldzAhSs0sGVx89le4AyOiTtOE3reScPRyP4MjsCQunI0nQN5Q0ltZ0PcDq-haPhJOsJuVtLxDl03a0_SdOADhsXN0ToOT1KfFKw04INVyl5Cl872sA7Oinjj6aqApQcmBCv3ewfycQ-DdbB3sgPP0oY3SmlpQqMm9HiYrKP7VfNX0zygGRXco4GQO0jlF-adNYRmloTWfFnm_o49TSFnx8oFV8Rh2iJen-50YnGDA2dix-KG39Z6XCEmqufhch--HNDsDCc3A0v3L_Z_1Sxla3oILv9nmM1_UJLyHUa1xn7LWAGfnk7QEfQsbT7U-Bb5N1H_JOjDlst6LePd-aO-TvsqrWQEdVJmuzQTWVlGUy3SLu-zXdWnAHlZDUWcl2kBWT_EWQWiiLAWscjjXJRJnCVJuZVtllRVXohdUfbQpiyLQUtUW6XOemvdGKH3M9RJluRlHinZgvKLP4XolDTjZrBOSwp3JT9Erg51m3YePctihZ78n06EpBZvvyjMD3y9qG8ttBqtf27a536NZqfqiegUHMDEkYnjiDTN7bazmoljAN9em5OzP6AjJo6LHs_E8SbpXIufAQAA__9bnVHG">