ioeric added inline comments. ================ Comment at: lib/Format/Format.cpp:1822 @@ +1821,3 @@ + cleanupRight(Line->First, Line->Last, tok::comma, tok::comma); + checkConstructorInitList(*Line); + } ---------------- ioeric wrote: > djasper wrote: > > You could turn this into: > > > > for (auto &Line : AnnotatedLines) { > > if (Line->Affected) { > > cleanupRight(Line->First, tok::comma, tok::comma); > > cleanupRight(Line->First, TT_CtorInitializerColon, tok::comma); > > cleanupLeft(Line->First, tok::comma, tok::l_brace); > > cleanupLeft(Line->First, TT_CtorInitializerColon, tok::l_brace); > > } > > } > Wouldn't `cleanupLeft(Line->First, tok::comma, tok::l_brace);` also remove > the comma from `std::vector<std::vector<int>> = {{...}, {...}}`? I should've added this case into unit test, sorry...
But I think we can either handle constructor initializer's tok::l_brace specially or annotate it? The later solution can enable us to do `cleanupLeft(Line->First, tok::comma, TT_CtorInitializerLBrace);`. http://reviews.llvm.org/D19804 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits