[clang] [clang-format] Add space after a word token (PR #92741)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 00:32:34 PDT 2024


================
@@ -5280,7 +5280,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
     // handled.
     if (Left.is(tok::amp) && Right.is(tok::r_square))
       return Style.SpacesInSquareBrackets;
-    return Style.SpaceAfterLogicalNot && Left.is(tok::exclaim);
+    return (Style.SpaceAfterLogicalNot && Left.is(tok::exclaim)) ||
+           Right.is(TT_BinaryOperator);
----------------
owenca wrote:

This line was deleted in #90161. Adding it back will hide the uncovered bug and only fix #92688 superficially IMO. For example, `SpaceBeforeAssignmentOperators` will have no effect.

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


More information about the cfe-commits mailing list