https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242
--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- (In reply to Jonathan Wakely from comment #4) > It's consteval, the throw is there to make it not a constant expression and > give an error if anything except 0 is used. i.e. it can never throw, it > either compiles or it doesn't. Sure, I understand that, but that should still result in a failure of a static assertion testing for noexcept, e.g. consider: struct __unspec { consteval __unspec(int __n) { if (__n != 0) throw __n; } }; static_assert(noexcept(__unspec(0))); int main() { }