owenpan added a comment. Like `while (a);`, `while (a) {}` is also an empty loop, so `NonEmpty` is misleading if it excludes the former but not the latter. IMO we should just fix the bug without extending the option because any loop with a single-statement body is a short loop.
================ Comment at: clang/unittests/Format/FormatTest.cpp:1444-1467 + verifyFormat("while (true) ;", + AllowsMergedLoops); + verifyFormat("for (;;) ;", + AllowsMergedLoops); + verifyFormat("for (;;)\n" + " for (;;) continue;", + AllowsMergedLoops); ---------------- There should be no spaces between `)` and `;`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154550/new/ https://reviews.llvm.org/D154550 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits