From 7c98155813e09227aab3b5f08479a322b935a8ba Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 3 Apr 2015 21:15:46 +0000 Subject: [PATCH] clang-format: [Proto] No alternate operator names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234055 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/Format.cpp | 3 +-- unittests/Format/FormatTestProto.cpp | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index b44ea5dc6d..76fed58f18 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -1506,8 +1506,7 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) { LangOpts.CPlusPlus11 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; LangOpts.CPlusPlus14 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1; LangOpts.LineComment = 1; - bool AlternativeOperators = Style.Language != FormatStyle::LK_JavaScript && - Style.Language != FormatStyle::LK_Java; + bool AlternativeOperators = Style.Language == FormatStyle::LK_Cpp; LangOpts.CXXOperatorNames = AlternativeOperators ? 1 : 0; LangOpts.Bool = 1; LangOpts.ObjC1 = 1; diff --git a/unittests/Format/FormatTestProto.cpp b/unittests/Format/FormatTestProto.cpp index 3a2f97e875..d55fe8cf09 100644 --- a/unittests/Format/FormatTestProto.cpp +++ b/unittests/Format/FormatTestProto.cpp @@ -93,6 +93,11 @@ TEST_F(FormatTestProto, MessageFieldAttributes) { " aaaaaaaaaaaaaaaa: AAAAAAAAAA\n" " bbbbbbbbbbbbbbbb: BBBBBBBBBB\n" "}];"); + verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n" + " type: \"AAAAAAAAAA\"\n" + " is: \"AAAAAAAAAA\"\n" + " or: \"BBBBBBBBBB\"\n" + "}];"); verifyFormat("repeated double value = 1 [(aaaaaaa.aaaaaaaaa) = {\n" " aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n" " bbbbbbb: BBBB,\n" -- 2.50.1