[PATCH] D116767: [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks in Java.
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 7 00:54:36 PST 2022
curdeius added inline comments.
================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1528
// for them (the one we know is missing are lambdas).
- if (Style.BraceWrapping.AfterFunction)
+ if ((Style.Language == FormatStyle::LK_Java) &&
+ Line->Tokens.front().Tok->is(Keywords.kw_synchronized)) {
----------------
owenpan wrote:
> curdeius wrote:
> > owenpan wrote:
> > > Remove redundant parens.
> > I don't think they're redundant because of 2 reasons: nested if and comment inside.
> > Cf. https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements.
> By "parens" I meant `(` and `)`. :)
Sorry, my bad.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116767/new/
https://reviews.llvm.org/D116767
More information about the cfe-commits
mailing list