https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100903
--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, that part's easy (and that's what we do in std::format for errors during format string parsing). But accepting (a <=> b) < (1-1) and other zero-valued constant expressions can't be solved by improving the diagnostics for ill-formed cases. (In reply to Jakub Jelinek from comment #6) > So, instead of adding a new compiler extension, couldn't we just add a hack > for this warning and temporarily disable the -Wzero-as-null-pointer-constant > warning > while doing convert_like_internal to std::__cmp_cat::__unspec convs->type, or > while build_over_call to the std::__cmp_cat::__unspec ctor? > Or add some attribute to that ctor which would cause the warning to be > temporarily disabled while handling its argument. This would be my preference.