curdeius added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1729
     } else if (Current.is(tok::r_paren)) {
       if (rParenEndsCast(Current))
         Current.setType(TT_CastRParen);
----------------
The current solution looks a bit like a hack to me.
Unless I'm mistaken, casts can appear only in expressions, but not in 
declarations (except for inside `decltype` stuff in templates or concepts, but 
these are still expressions at this level).
Given that `void operator delete...` is not an expression but a declaration, we 
shouldn't check `rParenEndsCast` in this case at all, no?
So, would it be possible to check here for e.g. `Line.MightBeFunctionDecl` or 
something like this to avoid it?

Also, how is it that you don't need to special-case `new` operator?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116920

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

Reply via email to