[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 29 11:43:38 PST 2022


curdeius accepted this revision.
curdeius added a comment.

LGTM but please add an assert(is_sorted).



================
Comment at: clang/lib/Format/FormatToken.h:126
+/// Sorted operators that can follow a C variable.
+static const std::vector<clang::tok::TokenKind> COperatorsFollowingVar = {
+    tok::l_square,     tok::r_square,
----------------
Is there a place anywhere that you verify it's sorted?
If no, please add an assert.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117416



More information about the cfe-commits mailing list