[PATCH] D80933: [clang-format] [PR46157] Wrong spacing of negative literals with use of operator

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 15:23:34 PDT 2020


curdeius added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:981
         consumeToken();
+        if (CurrentToken->is(tok::comma) &&
+            CurrentToken->Previous->isNot(tok::kw_operator))
----------------
Shouldn't you check `CurrentToken` for not being null after a call to `consumeToken`?? It may happen if `operator` is at the end of input (even if it's a degenerated case).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80933





More information about the cfe-commits mailing list