https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103760
--- Comment #4 from Jacek Olczyk <jacek.olczyk98 at gmail dot com> --- (In reply to Patrick Palka from comment #2) > GCC's behavior appears to be correct here (though perhaps less useful than > Clang's). According to wg21.link/temp.deduct.general#9 a lambda expression > isn't part of the immediate context, so substitution failure from within the > lambda ought to be a hard error, not a SFINAE error. Note that Clang also > doesn't reject the first four examples from that paragraph. Forgive me if I'm wrong (it's my first time reading into the standard), but this seems to be from a section explicitly talking about function templates, not templates in general - and function templates seem to be somewhat of a special case in many ways. I have not, however, been able to find the portion of the standard which delves into the relevant behavior in other templates.