[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 17 01:04:08 PST 2022
curdeius added inline comments.
================
Comment at: clang/lib/Format/WhitespaceManager.cpp:735-742
+ if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) {
+ FormatToken *Next = C.Tok->Next;
+ while (Next && Next->NewlinesBefore == 0) {
+ if (Next->Tok.is(tok::l_brace))
+ return false;
+ Next = Next->Next;
+ }
----------------
curdeius wrote:
> This should fix the `operator/**/ =` problem.
Can't we simplify this?
================
Comment at: clang/lib/Format/WhitespaceManager.cpp:738
+ while (Next && Next->NewlinesBefore == 0) {
+ if (Next->Tok.is(tok::l_brace))
+ return false;
----------------
And this should fix the declaration-only problem.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117421/new/
https://reviews.llvm.org/D117421
More information about the cfe-commits
mailing list