Closed
Description
The following code gets formatted inconsistently.
➜ ~ cat main.cpp
template <int num> void foo() {}
void bar() { return foo<true ? 1 : 2>(); }
int main() {
bar();
foo<true ? 1 : 2>();
return 0;
}
➜ ~ clang-format-18 main.cpp
template <int num> void foo() {}
void bar() { return foo < true ? 1 : 2 > (); }
int main() {
bar();
foo<true ? 1 : 2>();
return 0;
}
The foo function call inside bar()
is formatted differently than the one inside the main
function.
Mainly weird spaces are added to the template parameter