[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier
psigillito via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 26 20:33:40 PST 2022
psigillito marked an inline comment as done.
psigillito added inline comments.
================
Comment at: clang/lib/Format/FormatToken.h:125
+/// Operators that can follow a C variable.
+static const std::set<clang::tok::TokenKind> C_OperatorsFollowingVar = {
+ tok::l_square, tok::r_square,
----------------
curdeius wrote:
> HazardyKnusperkeks wrote:
> > And maybe choose a different container: https://llvm.org/docs/ProgrammersManual.html#set-like-containers-std-set-smallset-setvector-etc
> Not done it seems.
> Please rename and use a different type. Maybe `ImmutableSet`? Or just a sorted `std::vector`?
ok updated to sorted std::vector
================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:104
+
+ auto isAccessModifier = [this, &RootToken]() {
+ bool returnValue{false};
----------------
HazardyKnusperkeks wrote:
> In clang-format all lambdas I've seen start with a capital letter.
Updated.
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