MyDeveloperDay accepted this revision.
MyDeveloperDay added inline comments.
This revision is now accepted and ready to land.


================
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;
     }
----------------
jackhong12 wrote:
> 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.
 `it will be annotated as BinaryOperator by this rule.` of course my bad


================
Comment at: clang/unittests/Format/FormatTest.cpp:10541
+  verifyFormat("delete[] **ptr;", Style);
+  verifyFormat("delete[] *(ptr);", Style);
+
----------------
could you cover the other PointerAlignment case for completeness


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