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-XLdu2rDHVHKl-Fxxsb0Qj5rlJtnGSIwwVccFkegzAeDRPM66kFRG-kfp8U936HjW86LSIyY_4uq4czYmrBweWn8MoP8Q4ELv4VFv4N8qka34>52846</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Inconsistent indentation closing bracket of the lambda body
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
varqox
</td>
</tr>
</table>
<pre>
The following code:
```cpp
void foo() {
return some_function(
some_very_long_name_of_a_variable, another_variable_with_long_name, abc,
[] {
some_func();
other_func();
});
}
```
is formatted with the clang-format 13.
The fragment `});` is incorrectly indented relative to the lambda's body, it should be either:
```cpp
void foo() {
return some_function(
some_very_long_name_of_a_variable, another_variable_with_long_name, abc,
[] {
some_func();
other_func();
});
}
```
```cpp
void foo() {
return some_function(
some_very_long_name_of_a_variable, another_variable_with_long_name, abc,
[] {
some_func();
other_func();
});
}
```
If we change argument `abc` to `abcd`, then it is formatted to:
```cpp
void foo() {
return some_function(
some_very_long_name_of_a_variable, another_variable_with_long_name,
abcd, [] {
some_func();
other_func();
});
}
```
If we remove arguments `another_variable_with_long_name` and `abc`, it is formatted to:
```cpp
void foo() {
return some_function(some_very_long_name_of_a_variable, [] {
some_func();
other_func();
});
}
```
That is why I call the indentation in the first code example inconsistent.
My `.clang-format`:
```
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: MultiLine
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeComma
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: NoIndent
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: OuterScope
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: 4
ReferenceAlignment: Pointer
ReflowComments: true
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- STRINGIZE2
- ENUM_WITH_STRING_CONVERSIONS
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWVtz4rgS_jXkxZUUMSGXhzxw3fUOAQLkpOa8UMJug2aMxMgygf31pyX5Il9yeditc7bqpGYAqz-1Wn1Tt7zhwflxtQMn5FHE3yjbOj4PoNXptdrDVrvXum2bf_7hYEaOnAaI5i33vuU-OK27vhl38E-ATARzYr6HdZgwX1LOFC4HqD9NPYI4ryPOtmtG8JGHa7I-EkHJJoKWO3AI43IHIh9bv1G5KyZoyMbHrzLvVrff6g7LQuVrKomM1K1OhW4W-wDQuhvaw-qxrB_zSGNUjdgTKSFwlMgOMnb8iLDtpSE4150rg9VaF2S7ByYdxSFf4rbtICPKfC4E-DI64-8AUchTQEQkPYIjuWYdkf0mIC33LnY2aEqlFyqdeMeTKHA24ABVO_u_OS3AF01ZV5Xzj9TVV_T1V4aAFzpv6PI7dHlwiNgmmX8rodGz0XHNQ6Cm4GZwXaacthQ7kv8DfLbMVG8J5_1vGULAnh8LQ8Ra-Z_sDK1EWFDYLM0qf6uBvmSS_2o-SJM20Yp4250dz_FJFOk0bPIzUXvB33oopCKW-jB14ET2hwh0RmcxjSVirxyb7dNZafvKPijUwjUNm8fLy0vzY4LwhGzVcZ1tdZDZoOf7EMdPPKAhBTELwxikwl3epPSIblkvlEg7AOsL4v80gF70Rs5xXwD5aSOFIOdZuJQi8dGAECvolDOwMAPcHfiJOp-eiC_4J5heHOOA9sqPgX0qxxSi4BPYEFB_QhuhCTmKfXKAYApvEWVG_gmE0kKgIgQ6fmzUOeRM6mELsRK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