https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107861
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- Andrew is right. The C++ standard says this is ill-formed, the -fwrapv option isn't allowed to change that. The option means that runtime overflow is well-defined instead of undefined, but that doesn't change static compile-time behaviour that is ill-formed. Overflow in constant expressions and template arguments is still an error, even if the arithmetic would wrap at runtime.