[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

Filip Milosevic via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 28 12:46:40 PDT 2025


================
@@ -17630,6 +17630,13 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
   verifyFormat("int x = int (y);", SomeSpace2);
   verifyFormat("auto lambda = []() { return 0; };", SomeSpace2);
 
+  FormatStyle SpaceAfterOperatorKeyword = getLLVMStyle();
+  SpaceAfterOperatorKeyword.SpaceAfterOperatorKeyword = true;
+  verifyFormat("bool operator ++(int a)", SpaceAfterOperatorKeyword);
+  verifyFormat("bool operator --(int a)", SpaceAfterOperatorKeyword);
+  verifyFormat("bool operator <(int a)", SpaceAfterOperatorKeyword);
+  verifyFormat("bool operator >(int a)", SpaceAfterOperatorKeyword);
----------------
MightyFilipns wrote:

I have removed all but the last one

https://github.com/llvm/llvm-project/pull/137610


More information about the cfe-commits mailing list