krasimir marked 3 inline comments as done.
krasimir added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2722
+    FormatToken *Before = Left.getPreviousNonComment();
+    while (Before && Before->isOneOf(tok::kw_const, tok::kw_volatile)) {
+      Before = Before->getPreviousNonComment();
----------------
mprobst wrote:
> how many const and volatile may be there, and is their order fixed?
> 
> We also have the `endsSequence` helper on FormatToken that might express the 
> concept better (`Left.endsSequence(tok::kw_const, tok::kw_volatile) || ...`). 
> YMMV, with the tokens being optional that might lead to too many alternates 
> to check for.
Thank you! I think const and volatile can only appear once, and not both at the 
same time.
There are 3 cases to check for with `endsSequence` which is ok, and it's less 
code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72911



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

Reply via email to