HazardyKnusperkeks added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2138
+
+    // These keywords are deliberately not included here. They are either
+    // included in determineStarAmpUsage or determinePlusMinusCaretUsage.
----------------
I'm not sure about this. Why not handle them here too?


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2146-2147
+    //   know how they can be followed by a star or amp.
+    // co_await, delete - It doesn't make sense to have them followed by a 
unary
+    //   `+` or `-`.
+    if (PrevToken->isOneOf(TT_ConditionalExpr, tok::l_paren, tok::comma,
----------------
Especially here, why should a `+` after `delete` be a binary operator?
How much sense it makes doesn't matter, it is valid c++: 
https://gcc.godbolt.org/z/c1x1nn3Ej


================
Comment at: clang/unittests/Format/FormatTest.cpp:9758
+  verifyFormat("for (x = 0; -10 < x; --x) {\n}");
+  verifyFormat("sizeof -x");
+  verifyFormat("sizeof +x");
----------------
A format test is fine, a token annotator test would be better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121754

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

Reply via email to