<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/105480>105480</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-format: Trailing return type formatting regression starting from v18
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
liarokapisv
</td>
</tr>
</table>
<pre>
I get a formatting "regression" starting from clang-format v18
```cpp
- auto on_deactivate(rclcpp_lifecycle::State const & previous_state)
- -> hardware_interface::CallbackReturn override;
+ auto on_deactivate(rclcpp_lifecycle::State const & previous_state
+ ) -> hardware_interface::CallbackReturn override;
- auto register_group_bulk_write(Motor & m, std::vector<Motor *> & motor_write_list) const
- -> bool;
+ auto
+ register_group_bulk_write(Motor & m, std::vector<Motor *> & motor_write_list) const -> +bool;
```
This is with `IndentBlock` on `AlignAfterOpenBracket` and I can't seem to be able to reproduce the previous formatting.
Config:
```
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: false
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: false
ColumnLimit: 100
CompactNamespaces: true
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
PackConstructorInitializers: CurrentLine
PenaltyBreakAssignment: 10
PenaltyBreakComment: 10
PointerAlignment: Middle
QualifierAlignment: Right
ReferenceAlignment: Middle
SeparateDefinitionBlocks: Always
SpacesInContainerLiterals: false
Standard: c++17
TabWidth: 4
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VkFv67AN_jXORUjgKGmSHnJI0hYrljZd0-1hp4CWaVurLBkSnb7s1w-SncZ103fZsIeHtjA_Uh8_UhTBOZlrxGV0s45u7gZQU2HsUkmw5h0q6Y6DxKSn5SPLkRiwzNgSiKTOWcS5xdyic9LoiHPmCGywZNaUTCjQ-bDBs-N4EcV3Ubxqf87i5r-oqubLkDHGoCbDjD6kCILkEQgjvrBCiao6KJmhOAmF0WQVTVZ7AkImjHbEIj5jlcWjNLU7OAput52w_t8wmtyzAmz6ARYPUhPaDEQbbANKJSDeX5Fqq5k5orUyxWiybuny9f-WXjdqxG__S3Y9AS3m0hHaQ25NXR2SWr0fPqwMbJ8MGRsYlRHfMEdpc8YRBRkbTTZnwMozCjj_ofE_KOnI0w15XRM4MUZ9Uc0T-pLt_4lcQyfi66-Mzm3XFe6tkI5Jxz4kFSyaxY86RU1rZcR7NIuZ0f7jSslcrzJCu6tQry2IdyRvBp2yRyZAR3xOzCGWjAxLkEGikIVqVNaktUBGBX72QecejbpkNkZnMvdpX7streTDYfPHFnReQ-7bhG3OF2kNDtOd3tMp9CLbbv_x1A22EgKdezKpzCTaXZY5JI8bTlv71UwnKxYUacTpIDdGOxQ1ySM-gbDGBTKXjx3ovRNQYfqMH0pqDMAtZp_BlPlYKfUCFkoktG6X3aFQYIGk0Tv9jL9pK3XIKQPlsOO3L4xtKuZ2erWXOld4xq7UB5xcH7wBh1tIUH13IFt_i_1Qa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