[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 3 11:51:29 PST 2022
HazardyKnusperkeks added inline comments.
================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3574
+ // line.
+ FirstNonCommentOnLine |= FirstOnLine;
+ } else {
----------------
I really don't like bitwise operations on bool. Hit some nasty bugs at my job.
================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3580
while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) &&
- (FormatTok->HasUnescapedNewline || FormatTok->IsFirst)) {
+ FirstNonCommentOnLine) {
distributeComments(Comments, FormatTok);
----------------
This does not change within the loop, is that on purpose? Then it should be an if around the loop.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118924/new/
https://reviews.llvm.org/D118924
More information about the cfe-commits
mailing list