[PATCH] D94955: [clang-format] Treat ForEachMacros as loops

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 30 08:48:55 PST 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:995
 TEST_F(FormatTest, ForEachLoops) {
   verifyFormat("void f() {\n"
+               "  foreach (Item *item, itemlist) {\n"
----------------
GoBigorGoHome wrote:
> MyDeveloperDay wrote:
> > I'd like you to assert that short loops are off
> You mean make sure that `AllowShortLoopsOnASingleLine` is false?
> The default style of `verifyFormat` is LLVM style where `AllowShortLoopsOnASingleLine` is already false.
you should assert here to show that the previous tests were wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94955/new/

https://reviews.llvm.org/D94955



More information about the cfe-commits mailing list