================ @@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { - if (Right.isNot(tok::l_paren)) { + if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { ---------------- zygoloid wrote:
For `not!`, I think adding a space is the right choice for a C++ code formatter: `not !b` should probably be formatted with a space, not as `not!b`, even though it's a pretty strange thing to write. I wonder if this should instead be: ```suggestion if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::comma)) { ``` ... with the `)` and `,` cases firing only in places where we can locally tell this isn't actually a `not` operator at all. https://github.com/llvm/llvm-project/pull/78176 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits