llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) <details> <summary>Changes</summary> Fixes #<!-- -->149520 --- Full diff: https://github.com/llvm/llvm-project/pull/149695.diff 2 Files Affected: - (modified) clang/lib/Format/ContinuationIndenter.cpp (+1) - (modified) clang/unittests/Format/FormatTest.cpp (+5) ``````````diff diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 4010f7fbd25be..bf67f9e5fd241 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -560,6 +560,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { return true; } } else if (Current.is(TT_BinaryOperator) && Current.CanBreakBefore && + Current.getPrecedence() != prec::Assignment && CurrentState.BreakBeforeParameter) { return true; } diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 0bc1c6d45656e..11d94e47e5b06 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -28375,6 +28375,11 @@ TEST_F(FormatTest, BreakAfterAttributes) { verifyFormat("[[nodiscard]]\n" "Foo& operator-(Foo&);", Style); + + Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; + verifyFormat("[[deprecated]]\n" + "void f() = delete;", + Style); } TEST_F(FormatTest, InsertNewlineAtEOF) { `````````` </details> https://github.com/llvm/llvm-project/pull/149695 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits