https://bugs.llvm.org/show_bug.cgi?id=38525
Bug ID: 38525
Summary: incorrectly adds extra continuation indent spaces with
BreakBeforeBinaryOperators set to All
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Formatter
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Created attachment 20675
--> https://bugs.llvm.org/attachment.cgi?id=20675&action=edit
test case
Command line:
clang-format -style="{IndentWidth: 4, TabWidth: 4, UseTab: Always,
AlignAfterOpenBracket: DontAlign, AlignOperands: false,
BreakBeforeBinaryOperators: All}" BreakBeforeBinaryOperators.cpp
Output with incorrectly added extra spaces before "||":
bool BreakBeforeBinaryOperators(
bool someVeryVeryLongConditionThatBarelyFitsOnALine,
bool someOtherLongishConditionPart1,
bool someOtherEvenLongerNestedConditionPart2) {
return someVeryVeryLongConditionThatBarelyFitsOnALine
&& (someOtherLongishConditionPart1
|| someOtherEvenLongerNestedConditionPart2);
}
Expected output:
bool BreakBeforeBinaryOperators(
bool someVeryVeryLongConditionThatBarelyFitsOnALine,
bool someOtherLongishConditionPart1,
bool someOtherEvenLongerNestedConditionPart2) {
return someVeryVeryLongConditionThatBarelyFitsOnALine
&& (someOtherLongishConditionPart1
|| someOtherEvenLongerNestedConditionPart2);
}
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs