djasper 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,}}; }";
----------------
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?
https://reviews.llvm.org/D24501
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits