================
@@ -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)) {
----------------
owenca wrote:
> The only exception I see are identifiers and numeric literals (as they will
> combine the tokens together):
>
> ```c++
> v(not x)
> v(not 1)
> v(not 123.f)
> ```
+1.
> Should this condition be something like `if (Right.isOneOf(tok::ident, /*...
> numeric literals*/))`? Or will this cause us to not add spaces in undesired
> places?
>
> If we can avoid those spaces for only a limited set of tokens, I would
> probably limit this to `tok::lparen` and `tok::rparen`, the rest seems much
> less likely.
We should come up with a more general fix.
https://github.com/llvm/llvm-project/pull/78176
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits