[Bug c++/103760] Invalid expression inside lambda inside compound requirement causes an error instead of concept satisfaction failure

jacek.olczyk98 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Dec 19 09:30:46 GMT 2021


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.


More information about the Gcc-bugs mailing list