diff options
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/Format.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 140bda21938..255f5142f07 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1710,6 +1710,9 @@ private: unsigned Limit) { if (Limit == 0) return; + if (Style.BreakBeforeBraces == FormatStyle::BS_Allman && + (I + 1)->First->is(tok::l_brace)) + return; if ((I + 1)->InPPDirective != I->InPPDirective || ((I + 1)->InPPDirective && (I + 1)->First->HasUnescapedNewline)) return; diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index c80c297de22..56fe81f3f2b 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -930,6 +930,8 @@ void UnwrappedLineParser::parseEnum() { nextToken(); } if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BreakBeforeBraces == FormatStyle::BS_Allman) + addUnwrappedLine(); nextToken(); addUnwrappedLine(); ++Line->Level; |