diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 97fd98ecb94..e705c98c67b 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -811,9 +811,8 @@ void UnwrappedLineParser::parseStructuralElement() { // parseEnum falls through and does not yet add an unwrapped line as an // enum definition can start a structural element. parseEnum(); - // This does not apply for Java and JavaScript. - if (Style.Language == FormatStyle::LK_Java || - Style.Language == FormatStyle::LK_JavaScript) { + // This only applies for C++. + if (Style.Language != FormatStyle::LK_Cpp) { addUnwrappedLine(); return; } @@ -1554,6 +1553,9 @@ void UnwrappedLineParser::parseEnum() { // Java enums are different. parseJavaEnumBody(); return; + } else if (Style.Language == FormatStyle::LK_Proto) { + parseBlock(/*MustBeDeclaration=*/true); + return; } // Parse enum body. |