They don't really. In fact there are many things that are technically UB but are so common that compilers can't really treat them as UB. E.g. type punning via unions.
I write "in general" because, as with other forms of memory reinterpretation (memcpy or copy through a character type), evaluating a trap representation triggers UB.
[0] the C meaning of an object, not the C++ one
I would argue that most languages only have one compiler so it doesn't matter what is in the specification.