This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Handle PointerAlignment in `if` and `switch` statements with initializers (C++17) the same way as in `for` loops.
ClosedPublic

Authored by curdeius on Feb 12 2022, 1:49 PM.

Diff Detail

Event Timeline

curdeius requested review of this revision.Feb 12 2022, 1:49 PM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2022, 1:49 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
owenpan accepted this revision.Feb 12 2022, 2:24 PM
owenpan added inline comments.
clang/lib/Format/TokenAnnotator.cpp
31

Nit: rename the function to ...WithInit, ...WithInitStmt, or ...WithInitStatement.

This revision is now accepted and ready to land.Feb 12 2022, 2:24 PM
MyDeveloperDay accepted this revision.Feb 12 2022, 3:55 PM
clang/lib/Format/TokenAnnotator.cpp
32

Here a switch? I'm confused in which patch the function is added.

curdeius retitled this revision from [clang-format] Handle PointerAlignment in `if` statements with initializers (C++17) the same way as in `for` loops. to [clang-format] Handle PointerAlignment in `if` and `switch` statements with initializers (C++17) the same way as in `for` loops..Feb 13 2022, 12:35 PM
curdeius edited the summary of this revision. (Show Details)