llvm-project
llvm-project copied to clipboard
[clang-format] unexpected formatting on empty lines
command clang-format --lines=2:2 a.cc
actual formatting:
void f() {
}
expected formatting:
void f() {}
this seems to be WAI if there are tokens on line 2, e.g:
void f() {
return;
}
gets formatted as void f() { return; }.
@llvm/issue-subscribers-clang-format
Author: kadir çetinkaya (kadircet)
command `clang-format --lines=2:2 a.cc`
actual formatting:
void f() {
}
expected formatting:
void f() {}
this seems to be WAI if there are tokens on line 2, e.g:
void f() {
return;
}
gets formatted as void f() { return; }.
@llvm/issue-subscribers-c-1
Author: kadir çetinkaya (kadircet)
command `clang-format --lines=2:2 a.cc`
actual formatting:
void f() {
}
expected formatting:
void f() {}
this seems to be WAI if there are tokens on line 2, e.g:
void f() {
return;
}
gets formatted as void f() { return; }.
Here is a test repro.
TEST_F(FormatTestSelective, Repro) {
EXPECT_EQ("void f() {}\n", format("void f() {\n \n}\n", 13, 0));
}