[clang] [clang-format] Fix operator overload inconsistency in `BreakAfterAttributes: Always` (PR #74943)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 9 10:18:19 PST 2023


================
@@ -593,7 +593,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
         // name.
         !Style.isJavaScript()) ||
        (Current.is(tok::kw_operator) && Previous.isNot(tok::coloncolon))) &&
-      Previous.isNot(tok::kw_template) && CurrentState.BreakBeforeParameter) {
+      Previous.isNot(tok::kw_template) && CurrentState.BreakBeforeParameter &&
+      (Style.isCpp() && Current.Tok.isNot(tok::kw_operator))) {
----------------
HazardyKnusperkeks wrote:

Two things, you don't need the parenthesis, you are already in a conjunction.
Does it affect the other languages, that you now add a check for `isCpp()`?

https://github.com/llvm/llvm-project/pull/74943


More information about the cfe-commits mailing list