https://bugs.llvm.org/show_bug.cgi?id=42509
Bug ID: 42509
Summary: Inconsistent output when running clang-format twice
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Keywords: beginner
Severity: enhancement
Priority: P
Component: Formatter
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
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 (https://github.com/llvm-mirror/clang.git
b5cfeee0a6e73044cc755e2ab08145056b2d3fd4)
(https://github.com/llvm-mirror/llvm.git
57b4161e8fc497386cebf223cb8a26896303cb05)
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs