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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
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.

But I've remembered the problem with this technique, it allows non-literal
zeros:

constexpr int zero = 0;
auto c = (1 <=> 1) == zero;  // should be ill-formed.

This compiles OK, and isn't *obviously* wrong when reviewing the code.

The advantage of the current definition using a pointer is that nobody can
declare a constant of type __unspec without obviously using a reserved name and
venturing into undefined territory.

Reply via email to