I get what you mean, and I agree that it might be “sufficient” in some circumstances, but please consider that this might affect some tests that silently pass instead of failing. I don’t particularly like this chance-based programming, and I would not like to set foot on an airplane whose fly-by-wire system has been tested this way.
No no, definitely that one is not the only possiblility: it was just an example of an alternative to full UB.
This would be particularly nasty. If reassigning to a const
is UB (especially if the type is different), I don’t see any reason not to make it a hard error instead, since anything that follows it would be completely meaningless (actually, in C, UB is “retroactive” too, so also what precedes the invalid operation becomes meaningless: see this example).
In any case, I’ve opened this issue, where I’m not expecting plenty of spam regarding what UB is or isn’t (as witnessed in this thread), but rather a clarifying answer from the core developers.