[clang] [clang-format] Change SpaceAfterLogicalNot to enumeration type (PR #150166)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 23 01:14:09 PDT 2025


================
@@ -17762,14 +17762,19 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
 }
 
 TEST_F(FormatTest, SpaceAfterLogicalNot) {
-  FormatStyle Spaces = getLLVMStyle();
-  Spaces.SpaceAfterLogicalNot = true;
+  auto Spaces = getLLVMStyle();
+  EXPECT_EQ(Spaces.SpaceAfterLogicalNot, FormatStyle::SAN_Never);
 
+  Spaces.SpaceAfterLogicalNot = FormatStyle::SAN_Exclaim;
   verifyFormat("bool x = ! y", Spaces);
   verifyFormat("if (! isFailure())", Spaces);
   verifyFormat("if (! (a && b))", Spaces);
   verifyFormat("\"Error!\"", Spaces);
   verifyFormat("! ! x", Spaces);
----------------
HazardyKnusperkeks wrote:

Add a ``not`` test here?

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


More information about the cfe-commits mailing list