[Bug c++/94252] Can't use a lambda in a requires expression

julius_huelsmann at freenet dot de gcc-bugzilla@gcc.gnu.org
Mon Mar 23 11:38:51 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94252

--- Comment #1 from Julius Hülsmann <julius_huelsmann at freenet dot de> ---
This seems to apply to member functions aswell; the following assertion fails
aswell on gcc-trunk on [compilerExplorer](https://godbolt.org/z/NxgkH5)

struct T { int f(int) noexcept; };

int main() {
  static_assert(requires(T o, int i) {
    o.f(i);
    //{ o.f(i) } noexcept->std::same_as<int>; //< also fails.
  });
}


More information about the Gcc-bugs mailing list