[PATCH] D126758: [clang-format] Handle do-while loops for RemoveBracesLLVM
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 1 03:26:12 PDT 2022
curdeius accepted this revision.
curdeius added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/unittests/Format/FormatTest.cpp:25103
- // The following eight test cases are fully-braced versions of the examples at
+ // The following nine test cases are fully-braced versions of the examples at
// "llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-
----------------
Nit. To avoid updating it every time we add an example.
================
Comment at: clang/unittests/Format/FormatTest.cpp:25407-25411
+ verifyFormat("do {\n"
+ " ++I;\n"
+ "} while (hasMore() && Filter(*I));",
+ "do { ++I; } while (hasMore() && Filter(*I));",
+ Style);
----------------
What's the value of testing that newlines are added? That's not really the job of Insert/RemoveBraces.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126758/new/
https://reviews.llvm.org/D126758
More information about the cfe-commits
mailing list