<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77778>77778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] AlignOperands: DontAlign produces somewhat unexpected result
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
elvenfighter
</td>
</tr>
</table>
<pre>
With a config file like this:
```yaml
Language: Cpp
Standard: c++17
ColumnLimit: 60
IndentWidth: 4
ContinuationIndentWidth: 8
BreakBeforeBinaryOperators: NonAssignment
BinPackArguments: true
AlignAfterOpenBracket: DontAlign
AlignOperands: DontAlign
# this was used to format the original code
#AlignOperands: Align
```
The following code:
```cpp
void test() {
{
{
{
int value = 24;
LOG_STUFF(1, "[Tag] debug:" + __FILE__
+ " value = " + value
+ "some " + "more "
+ "text");
}
}
}
}
```
Changes to
```cpp
void test() {
{
{
{
int value = 24;
LOG_STUFF(1,
"[Tag] debug:" + __FILE__
+ " value = " + value
+ "some " + "more "
+ "text");
}
}
}
}
```
I.e. the tail operands still remain aligned to the first operand with the `ContinuationIndentWidth: 8`. However the whole function argument is placed on its own row for that reason. While `AlignOperands: Align` produces a bit more compact result.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVV9vuzYU_TTm5aoRMYHAAw-hWbZK1Trp16mPkWMu4NXYyL4kv377ySRp039bq82qGjg-PtjnwL3Ce9UaxJKlFUvXkRips65EvUfTqLYjdNHO1k_lg6IOBEgbYGiURtDqEYE65VmyYvGaxSuWxce_J9HrI3QrTDuKFlmyguthOII_SJhauDqAkvGK8Wq-PElM_6-tHntzq3pFgZPFR_jG1GjoQdXUBXhxJhtSZhSkrHnDyC9FK4fiscLGOqyUEe7pbkAnyLpwAPjdmtVkRo-GTguU-UPIx5VrxwBONHIjHmdXWrVm1RC6uwFN5YR8xGm3a2tomrzgTY8ytf9gnvFk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