https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93152
--- Comment #1 from DB <db0451 at gmail dot com> ---
I believe this is also probably related to the fact that the WeirdSub1 template
argument is coming via a pointer-to-member function, although I haven't 100%
narrowed that down yet, I don't think.
The mentioned ICE can be minimised further, but this again works if the
template argument orders are swapped, so I think/hope it might have the same
root cause.
```#include <concepts>
struct WeirdBase {};
struct WeirdSub: WeirdBase {
void mem_fun() {}
};
template <typename Object, typename Result, typename... Args>
using MemFun = Result (Object::*)(Args...);
#if 1 // fails
template <typename Result, std::derived_from<WeirdBase> WeirdSub1,
#else // works
template <std::derived_from<WeirdBase> WeirdSub1, typename Result,
#endif
typename... Args>
auto
make_lambda( MemFun<WeirdSub1, Result, Args...> )
{
return [](std::derived_from<WeirdSub1> auto&&){};
}
auto
main() -> int
{
auto const lambda = make_lambda(&WeirdSub::mem_fun);
lambda( WeirdSub{} );
return 0;
}
```