https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104358
--- Comment #1 from qingzhe huang <nickhuang99 at hotmail dot com> ---
Sorry about the long description and here is the short version to highlight the
core issue. Given this template function with a templated lambda as parameter:
template<typename T>
using Lambda=decltype(+[](T){});
template<typename T>
auto foo(T&&, Lambda<T>)->T;
GCC considers the parameter "Lambda<T>" as type "int" which is wrong:
static_assert(is_same_v<decltype(&foo<int>),
int(*)(int&&, /*"Lambda<T>"*/ int)>);