summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Format/Format.cpp2
-rw-r--r--clang/unittests/Format/FormatTestProto.cpp12
2 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 9a2da69e89b..4a67cdeedf3 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -819,7 +819,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single;
GoogleStyle.JavaScriptWrapImports = false;
} else if (Language == FormatStyle::LK_Proto) {
- GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
+ GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
GoogleStyle.SpacesInContainerLiterals = false;
GoogleStyle.Cpp11BracedListStyle = false;
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index d25aeb846a9..70ef2d2f134 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/unittests/Format/FormatTestProto.cpp
@@ -397,29 +397,25 @@ TEST_F(FormatTestProto, FormatsService) {
}
TEST_F(FormatTestProto, ExtendingMessage) {
- verifyFormat("extend .foo.Bar {\n"
- "}");
+ verifyFormat("extend .foo.Bar {}");
}
TEST_F(FormatTestProto, FormatsImports) {
verifyFormat("import \"a.proto\";\n"
"import \"b.proto\";\n"
"// comment\n"
- "message A {\n"
- "}");
+ "message A {}");
verifyFormat("import public \"a.proto\";\n"
"import \"b.proto\";\n"
"// comment\n"
- "message A {\n"
- "}");
+ "message A {}");
// Missing semicolons should not confuse clang-format.
verifyFormat("import \"a.proto\"\n"
"import \"b.proto\"\n"
"// comment\n"
- "message A {\n"
- "}");
+ "message A {}");
}
TEST_F(FormatTestProto, KeepsLongStringLiteralsOnSameLine) {
OpenPOWER on IntegriCloud