Fixes https://github.com/llvm/llvm-project/issues/27146.
Fixes https://github.com/llvm/llvm-project/issues/52943.
Before:
namespace ns {
void foo() {
std::variant<int, double> v;
std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr; }}, v);
}
} // namespace ns
int break_me() {
int x = 42;
return int{[x = x]() {
return x;
}()};
}got formatted as:
namespace ns {
void foo() {
std::variant<int, double> v;
std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr;
}
} // namespace ns
, v);
}
} // namespace ns
int break_me() {
int x = 42;
return int{[x = x](){return x;
}
()
}
;
}