djasper added inline comments.
================
Comment at: lib/Format/ContinuationIndenter.cpp:1579
(Text.startswith(Prefix = "_T(\"") && Text.endswith(Postfix = "\")")))
{
+ unsigned UnbreakableTailLength = (State.NextToken && canBreak(State))
+ ? 0
----------------
I think a comment might help here. Specifically, it should mention that this is
required for the special case where there is an unbreakable tail only if
certain other formatting decisions have been taken. The UnbreakableTailLength
is an overapproximation in that case and we need to be correct here.
Thinking about this some more, there might actually be cases where this is
still not correct as the unbreakable tail is neither 0 nor the precomputed
value.
E.g. can we construct a case where there is a trailing comma in a braced list?
Maybe this:
vector<string> x = {"aaaaaa",};
In this case, I think the comma will always be part of the string literal, but
the "};" only get part of the tail if we don't wrap after the "{".
Repository:
rC Clang
https://reviews.llvm.org/D42376
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits