| Issue |
55476
|
| Summary |
[clang-format]: function argument default value continuation indent is missing
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
igagis
|
# to reproduce
`.clang-format`:
```yaml
---
AlignAfterOpenBracket: BlockIndent
ColumnLimit: '120'
ContinuationIndentWidth: '1'
Standard: Latest
TabWidth: '1'
UseCRLF: 'false'
UseTab: ForContinuationAndIndentation
...
```
`main.cpp`:
```cpp
void func(
type arg
= default_value
);
void func(
type loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_arg
= default_value
);
void func(
type arg
#if MACRO
= default_value
#endif
);
void func(
type arg //
= default_value
);
void func(
type arg = //
default_value
);
```
run
```console
clang-format main.cpp
```
# expected result
```cpp
void func(type arg = default_value);
void func(
type loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_arg =
default_value
);
void func(
type arg
#if MACRO
= default_value
#endif
);
void func(
type arg //
= default_value
);
void func(
type arg = //
default_value
);
```
# actual result
```cpp
void func(type arg = default_value);
void func(
type loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_arg =
default_value
);
void func(
type arg
#if MACRO
= default_value
#endif
);
void func(
type arg //
= default_value
);
void func(
type arg = //
default_value
);
```
Continuation indentation of `default_value` in latter 3 function declarations is missing.
# version
```console
$ clang-format --version
Debian clang-format version 15.0.0-++20220513071846+693758b28295-1~exp1~20220513071937.249
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs