[PATCH] D119597: [clang-format][NFC] Give State.Stack.back() a meaningful name
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 12 00:19:59 PST 2022
curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.
LGTM whether you keep it as is or use a pointer.
It looks like it would be cool if we had some sort of expression aliases in the language... `using CurrentState = State.Stack.back()`... One can always dream... :)
================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:1356
moveStatePastScopeCloser(State);
+ // Do not use CurrentState here, since the two functions before may change the
+ // Stack.
----------------
Maybe it would be better to use a pointer instead of a reference and then you could rebind it to the need `back()`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119597/new/
https://reviews.llvm.org/D119597
More information about the cfe-commits
mailing list