]> granicus.if.org Git - clang/commitdiff
clang-format: [Proto] No alternate operator names.
authorDaniel Jasper <djasper@google.com>
Fri, 3 Apr 2015 21:15:46 +0000 (21:15 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 3 Apr 2015 21:15:46 +0000 (21:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234055 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Format.cpp
unittests/Format/FormatTestProto.cpp

index b44ea5dc6d5f3ccec051f8b28f187c835ffedb4b..76fed58f1892399c7f9583ea86fb5a3680fb0aa5 100644 (file)
@@ -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;
index 3a2f97e875d14c76e9960921e11da8960f0deb15..d55fe8cf0934262f77b35e7c288398709906cf0b 100644 (file)
@@ -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"