r234055 - clang-format: [Proto] No alternate operator names.
Daniel Jasper
djasper at google.com
Fri Apr 3 14:15:47 PDT 2015
Author: djasper
Date: Fri Apr 3 16:15:46 2015
New Revision: 234055
URL: http://llvm.org/viewvc/llvm-project?rev=234055&view=rev
Log:
clang-format: [Proto] No alternate operator names.
Modified:
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/unittests/Format/FormatTestProto.cpp
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=234055&r1=234054&r2=234055&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Fri Apr 3 16:15:46 2015
@@ -1506,8 +1506,7 @@ LangOptions getFormattingLangOpts(const
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;
Modified: cfe/trunk/unittests/Format/FormatTestProto.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestProto.cpp?rev=234055&r1=234054&r2=234055&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTestProto.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTestProto.cpp Fri Apr 3 16:15:46 2015
@@ -94,6 +94,11 @@ TEST_F(FormatTestProto, MessageFieldAttr
" 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"
" bbbb: BBB\n"
More information about the cfe-commits
mailing list