3 ms·
> UB is a runtime thing, [...] Compare and contrast https://stackoverflow.com/a/11546378 https://stackoverflow.com/a/11546378 > FNDR is there because these ar
by eru 3y ago
> UB is a runtime thing, [...]
Compare and contrast https://stackoverflow.com/a/11546378 https://stackoverflow.com/a/11546378
> FNDR is there because these are non-trivial semantic properties, so by Rice's Theorem they're Undecidable, the compiler cannot be sure if every arbitrary program meets the semantic requirement.
As pointed out elsewhere, Rice's theorem does not force this choice. You could also be conservative: insist on only disallowing all 'bad' programs at the price of banning some 'good' programs. C++'s type system already disallows plenty of 'good' programs anyway.
> My belief (and some well known C++ people agree) is that the vast majority of real world C++ programs today are Ill-Formed by these definitions and so do not have and never had any meaning by the text of the standard. I think this is substantially worse than the situation in C.
Thanks! That's the kind of answer I was trying to get!