[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent
Emilia Dreamer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 9 23:50:00 PST 2022
rymiel added a comment.
This patch will probably need unit tests
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:5004-5005
const FormatToken *Previous = Right.MatchingParen->Previous;
- return !(Previous && (Previous->is(tok::kw_for) || Previous->isIf()));
+ // avoid breaking when there is an opening parens immediately following
+ // a closing parens, such as in cast operators and indirect function calls
+ return !((Previous && (Previous->is(tok::kw_for) || Previous->isIf())) ||
----------------
Please follow the convention on comments as seen on surrounding lines (i.e. use proper sentences with capitalization and a full stop at the end)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137762/new/
https://reviews.llvm.org/D137762
More information about the cfe-commits
mailing list