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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-24
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.1.0, 11.1.0, 12.1.0,
                   |                            |13.1.0, 14.1.0, 15.0
     Ever confirmed|0                           |1
            Summary|Absurd "flows off the end   |Absurd "flows off the end
                   |of the function" diagnostic |of the function" diagnostic
                   |with requires expression    |with requires expression
                   |containing only lambda(s)   |containing only lambda(s)
                   |                            |without being inside a
                   |                            |template

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Not a regression.

Interesting once we change f into a template:
```
template<int T>
constexpr bool g() {
  return requires {
    [] {};
  };
}
int t = g<1>();
static_assert(g<1>());
```
It works.

Note also GCC 9 (and before), requires was not supported outside of a template:
`a requires expression cannot appear outside a template`. Maybe this is related
to that ...

Reply via email to