diff options
| author | Daniel Jasper <djasper@google.com> | 2015-04-03 21:15:46 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2015-04-03 21:15:46 +0000 |
| commit | 1662bfe07739a4c852d91c98b9d274a50394c279 (patch) | |
| tree | f418c7aa9b80e66a481612f1f8ce23ff41b9b9f6 /clang | |
| parent | 2181c10b5bf6435c90d0118bf36a88dc0ae3113e (diff) | |
| download | bcm5719-llvm-1662bfe07739a4c852d91c98b9d274a50394c279.tar.gz bcm5719-llvm-1662bfe07739a4c852d91c98b9d274a50394c279.zip | |
clang-format: [Proto] No alternate operator names.
llvm-svn: 234055
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Format/Format.cpp | 3 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index b44ea5dc6d5..76fed58f189 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/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/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index 3a2f97e875d..d55fe8cf093 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -94,6 +94,11 @@ TEST_F(FormatTestProto, MessageFieldAttributes) { " 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" |

