<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - A newline is added after a string token if the next 2 tokens are lessless and string"
href="https://bugs.llvm.org/show_bug.cgi?id=45018">45018</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>A newline is added after a string token if the next 2 tokens are lessless and string
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jeffrey.vandeglind@nobelbiocare.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=23166" name="attach_23166" title="File to verify two streamed strings aren't split">attachment 23166</a> <a href="attachment.cgi?id=23166&action=edit" title="File to verify two streamed strings aren't split">[details]</a></span>
File to verify two streamed strings aren't split
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>