Consider the requires expression:
constexpr auto b = requires { []{}; };
GCC pass the following two static_assert:
static_assert(b);
static_assert(!b);
This looks extremely weird. I expect that the value of b should be true. Is this just a GCC Bug?
This isn't Schrödinger's Requirement:
bshould clearly be eithertrueorfalse.The requirement here:
is a simple-requirement. We're just checking that if the expression
[]{}is a valid expression. And... it is! Sobshould just be true. This is a gcc bug (and doubly so with StoryTeller's example demonstrating that in a slighly different spellingbdoesn't even count as a constant expression).