[PATCH] D24501: Remove redundant comma around parenthesis in parameter list.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 06:36:14 PDT 2016


ioeric added inline comments.

================
Comment at: unittests/Format/CleanupTest.cpp:147
@@ +146,3 @@
+  // Trailing comma in braces is not removed.
+  std::string Code = "void f() { std::vector<int> v = {1,2,,,3,{4,5,}}; }";
+  std::string Expected = "void f() { std::vector<int> v = {1,2,3,{4,5,}}; }";
----------------
djasper wrote:
> Seems like it's worth to pull out a function getting (offset, input, expected output) and then doing all this. Of course doesn't *have* to be in this patch, but I guess now is as good a time as any.
> 
> Once that is done and we don't need to duplicate so much code, I think it might be worth duplicating this test to have it with and without trailing comma.
> 
> Also, I think there is actually a FIXME here. Lets assume I mark the offset that you put into ranges as X, then I think:
> - {a, b, X} should lead to {a, b}
> - {a, b, X,} should lead to {a, b,}
> Does that make sense?
Yep, make sense :)


https://reviews.llvm.org/D24501





More information about the cfe-commits mailing list