Skip to content

[clang-format] Wrong formatting when template variable is last thing before closing parenthesis #120148

@vient

Description

@vient
auto t1 = a<int> + b;
auto t2 = (b) + b;
auto t3 = (a<int>) + b;
auto t4 = (a<int> + 1) + b;

is formatted as

auto t1 = a<int> + b;
auto t2 = (b) + b;
auto t3 = (a<int>)+b;  // wrong, no spaces around +
auto t4 = (a<int> + 1) + b;

https://godbolt.org/z/9K11MrPz9 clang-format version 20.0.0git (https://github.com/llvm/llvm-project.git 8daf4f16fa08b5d876e98108721dd1743a360326)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions