If a do-while loop is in the block of a control statement, do not remove the braces.
Also updates the unit tests to match the updated LLVM Coding Standards. (See D126512.)
Paths
| Differential D126758
[clang-format] Handle do-while loops for RemoveBracesLLVM ClosedPublic Authored by owenpan on Jun 1 2022, 1:29 AM.
Details Summary If a do-while loop is in the block of a control statement, do not remove the braces. Also updates the unit tests to match the updated LLVM Coding Standards. (See D126512.)
Diff Detail
Event Timelinecurdeius added inline comments.
This revision is now accepted and ready to land.Jun 1 2022, 3:26 AM
This revision was landed with ongoing or failed builds.Jun 2 2022, 1:08 AM Closed by commit rGdb15e3121243: [clang-format] Handle do-while loops for RemoveBracesLLVM (authored by owenpan). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 433679 clang/lib/Format/UnwrappedLineParser.h
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
|
Should we merge that to something like KeepBraces? Or do we use HasLabel and HasDoWhile differently?