<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 - Inconsistent output when running clang-format twice"
href="https://bugs.llvm.org/show_bug.cgi?id=42509">42509</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inconsistent output when running clang-format twice
</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>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>beginner
</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>tomasz.g.markiewicz@gmail.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>Single runs and double runs of the `clang-format' are not consistent between
themselves. See the example below.
file: example.cc:
--------------------------
void foo() {
/* Empty */
}
Single run
----------------------------
$ style=LLVM; cat example.cc | clang-format --style=${style}
Result:
void foo() { /* Empty */ }
Double run
----------------------------
$ style=LLVM; cat example.cc | clang-format --style=${style} | clang-format
--style=${style}
Result:
void foo() { /* Empty */
}
The same is for style=Google.
Mozilla, Chromium and WebKit styles (obviously) work fine. (These probably do
not merge an empty function into one line.)
Version:
----------------
$ clang-format --version
clang-format version 9.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
b5cfeee0a6e73044cc755e2ab08145056b2d3fd4)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
57b4161e8fc497386cebf223cb8a26896303cb05)</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>