考虑requires表达式:
constexpr auto b = requires { []{}; };
GCC pass了以下两个static_assert
:
static_assert(b);
static_assert(!b);
这看起来非常奇怪。我期望b
的值应该是true
。这只是GCC的一个Bug吗?
b
声明为布尔值,情况会变得更奇怪。https://godbolt.org/z/1ebTP6 - StoryTeller - Unslander Monica