Before:
someObject.and ();
After:
someObject.and();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221978
91177308-0d34-0410-b5e6-
96231b3b80d8
LangOpts.CPlusPlus11 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1;
LangOpts.CPlusPlus14 = Style.Standard == FormatStyle::LS_Cpp03 ? 0 : 1;
LangOpts.LineComment = 1;
- LangOpts.CXXOperatorNames =
- Style.Language != FormatStyle::LK_JavaScript ? 1 : 0;
+ bool AlternativeOperators = Style.Language != FormatStyle::LK_JavaScript &&
+ Style.Language != FormatStyle::LK_Java;
+ LangOpts.CXXOperatorNames = AlternativeOperators ? 1 : 0;
LangOpts.Bool = 1;
LangOpts.ObjC1 = 1;
LangOpts.ObjC2 = 1;
}
};
+TEST_F(FormatTestJava, NoAlternativeOperatorNames) {
+ verifyFormat("someObject.and();");
+}
+
TEST_F(FormatTestJava, ClassDeclarations) {
verifyFormat("public class SomeClass {\n"
" private int a;\n"