jackhong12 added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2381-2385
     if (PrevToken->Tok.isLiteral() ||
         PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::kw_true,
                            tok::kw_false, tok::r_brace)) {
       return TT_BinaryOperator;
     }
----------------
The `*` token in `delete *x;` will be annotated as UnaryOperator (dereferencing 
a pointer). 

In the case `delete[] *x;`, there is a `]` before `*`. So, it will be annotated 
as BinaryOperator by this rule.

I think both `*` here should be UnaryOperator. Therefore, I add a new rule to 
match the `delete[]` pattern.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132911/new/

https://reviews.llvm.org/D132911

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to