Description
I believe clang-format is incorrectly formatting dereference operator with BreakBinaryOperations: OnePerLine
In example code:
return segment < *this or *this < segment;
Clang-format should correctly infer '*' operator in this context is not a multiplication but rather a dereference of this pointer. Instead I get the following formatting:
return segment < *this or * this < segment;
Full config:
# clang-format >= 20 AccessModifierOffset: -4 AlignAfterOpenBracket: BlockIndent AllowAllArgumentsOnNextLine: false AllowShortBlocksOnASingleLine: Always AllowShortCaseExpressionOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false AllowShortCompoundRequirementOnASingleLine: true AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: Empty AllowShortLambdasOnASingleLine: All AlwaysBreakTemplateDeclarations: true BinPackArguments: false BinPackParameters: false BraceWrapping: AfterCaseLabel: true AfterClass: true AfterControlStatement: Always AfterEnum: true AfterFunction: true AfterNamespace: true AfterObjCDeclaration: true AfterStruct: true AfterUnion: true AfterExternBlock: true BeforeCatch: true BeforeElse: true BeforeLambdaBody: true BeforeWhile: true SplitEmptyFunction: false SplitEmptyNamespace: false SplitEmptyRecord: false BreakBeforeBraces: Custom BreakBinaryOperations: OnePerLine ColumnLimit: 250 IndentRequiresClause: false IndentWidth: 4 KeepEmptyLines: AtEndOfFile: false AtStartOfBlock: false AtStartOfFile: false TabWidth: 4 Standard: Latest PenaltyExcessCharacter: 100 PenaltyIndentedWhitespace: 10 PenaltyReturnTypeOnItsOwnLine: 1000 RequiresExpressionIndentation: OuterScope RequiresClausePosition: OwnLine SeparateDefinitionBlocks: Always
Metadata
Metadata
Assignees
Type
Projects
Status