clang-format: Fix bad merging of lines in nested blocks.
Before:
SomeFunction([]() {
#define A a
return 43; });
After:
SomeFunction([]() {
#define A a
return 43;
});
llvm-svn: 220684
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index b9d13ab..8960823 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1277,6 +1277,9 @@
return true;
}
+ if (Previous.Children[0]->First->MustBreakBefore)
+ return false;
+
// Cannot merge multiple statements into a single line.
if (Previous.Children.size() > 1)
return false;