https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119222
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- That's a completely different example though. The bug is about conversion from double to int. 1/0 does not involve any floating-point types, it's just an undefined integer division. 1/static_cast<double>(0) is not undefined, it produces an infinite double value, it's only undefined when converted to int. Your example doesn't show that.