PriMee added a comment.

I merged them just because of their presence in the same bug report... As to 
the unit tests, I'll add them as soon as possible.

With reference to `extern` part, once again:
There is no brace wrapping flag that let us control opening brace's position. 
In case of other keywords (class, function, control statement etc.) we have 
opportunity to decide how should it look like. Here, we can't do it similarly. 
What we want is leaving braces **unformatted** (leave them as in the input), 
but what's more we still want to call **parseBlock** function. The only option 
is to set MustBreakBefore flag manually (only when needed, when the left brace 
is on non-header line, parseBlock does move it by default).

One more correction: Would be probably better to replace the line 
`MustBreakBeforeNextToken = true;` with `FormatTok->MustBreakBefore = true;`
It does work as expected as well (still passes every test - there are some!), 
but is more intuitive and understandable.

I'll work on these problems on monday.


https://reviews.llvm.org/D37143



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to