curdeius added inline comments.
================ Comment at: clang/unittests/Format/FormatTest.cpp:1947 verifyFormat("int&& c = f3();", Style); + verifyFormat("for (auto a = 0, b = 0; const auto& c : {1, 2, 3})", Style); ---------------- HazardyKnusperkeks wrote: > curdeius wrote: > > curdeius wrote: > > > How about pointers/references in the init? Also, please test sth else > > > than auto, both in init and as the loop variable. > > I think that you're still missing non-auto variable declarations in init. > > Also, you can add a statement not being a variable declaration in the init. > I think he meant something like > `for (foo(); auto c : ...)` Indeed. I'd like to see tests like these (some of them are already there): ``` for (auto x = 0; auto& c : {1, 2, 3}) for (auto x = 0; int& c : {1, 2, 3}) for (int x = 0; auto& c : {1, 2, 3}) for (int x = 0; int& c : {1, 2, 3}) for (f(); auto& c : {1, 2, 3}) for (f(); int& c : {1, 2, 3}) ``` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115050/new/ https://reviews.llvm.org/D115050 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits