diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -398,6 +398,8 @@ Changes[OuterScopeStart - 1].Tok->is(TT_LambdaLBrace)) return false; } + if (Changes[ScopeStart].NewlinesBefore > 0) + return false; return true; } diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -18023,6 +18023,12 @@ "}", Style); + verifyFormat("unsigned i = 0;\n" + "int a[] = {\n" + " 1234567890,\n" + " -1234567890};", + Style); + Style.ColumnLimit = 120; // clang-format off