Closed
Description
Continuation of #56176 (@HazardyKnusperkeks).
Tweaking the original example in that issue by adding &
to the trailing return and using decltype(...)
in the requires clause breaks it:
template<typename T>
struct Foo
{
auto bar(T in) -> int& requires (is_integral_v<decltype(in)>) {
call_something();
return 0;
}
};
Changing one of the following fixes the formatting again:
-> int&
to-> int
decltype(in)
toT
requires (...)
torequires ...
You need parens if you negate ((!...)
), but I guess a (highly arbitrary looking) workaround is to change from
requires (is_integral_v<decltype(in)>)
to
requires is_integral_v<decltype(in)> || true
works (tested).
$ clang++ --version
Homebrew clang version 17.0.6