Description
Bugzilla Link | 45018 |
Version | trunk |
OS | Windows NT |
Attachments | File to verify two streamed strings aren't split |
Extended Description
Given the code:
QStringList() << "something" << "something" << variable;
If I then run clang-format with the default config file, the output is the following code:
QStringList() << "something"
<< "something" << variable
What I expected, was that it stays on a single line, unless it exceeds the column limit and possible penalties. In this case, untouched.
It stays untouched when I add a variable in between:
QStringList() << "something" << a << "something" << variable;
Looking at the code, I noticed that somebody intentionally introduced this to split endline characters in commit df28f7b8dd6a032515109de4ff5b4067be95da8e (currently at lib/Format/TokenAnnotator.cpp, line 3073).
In the attachment I added a file with a slightly different example that I used when debugging clang-format.