https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102721
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Confirmed,
> Here is a better example of what is going wrong:
> template<class T>
> struct A
> {
> void foo(const T){}
> };
>
> using t = decltype(+[]{})[3];
> using t1 = const decltype(+[]{})[3];
>
> template<>
> void A<t>::foo(t1)
> {}
>
> template<>
> void A<decltype(+[]{})[4]>::foo(const decltype(+[]{})[4])
> {}
>
> The first template specialization is accepted but the second one is not.
Note it is not array related either:
template<>
void A<decltype(+[]{})>::foo(const decltype(+[]{}))
{}