You aren't writing IEEE code.
You're writing C++ code.
The compiler implements C++ code.
Therefore the compiler follows the C++ standards, which says it can do whatever it wants to divide by zero, even if the machine you're building for follows a IEEE standard that defines division by zero.
Not sure if I can agree entirely with any of those points. When considering this type of floating point math it's just not that simple.. there's not really such a thing. Just because the standard allows for something to be undefined, it's not necessarily actually undefined in implementations.
There is a defined flag in numerical_limits for example that tells us if we have IEEE.. so say that I add assert(IEEE) to the top of my program.. is it then well-defined according to the C++ standard?
I really think that the division by zero being undefined is a technicality for floating point.. if we have a certain floating point implementation it should most certainly override it.
Also, the C++ standard is incredibly incomplete in itself when it comes to floating point.. but it also specifically states that it's not meant to be read by itself.
The following referenced documents are indispensable for the application of this document.
ISO/IEC 9899:1999, Programming languages – C
Now that C-standard actually devotes chapters to floating point math, and makes much stricter guarantees than I expected. I'm not sure how much of it is optional, and in either case much of it goes out the window when accepting compiler-specific shortcuts and unsafe optimizations such as -ffast-math.. as it makes very strict guarantees for a certain floating point model, even specifying rounding-modes.
I would consider the very existence of standard floating point code dubious, if we don't accept one specific floating-point definition (such as IEEE)
The C standard floating point appendix even defines functions for setting exception-handling as well as a constant for the specific division by zero exception..