Hacker News new | ask | show | jobs
by layer8 1168 days ago
(nevermind)
2 comments

Successful compilation of UB is explicitly disallowed by the standard in a constexpr context
Thanks, I wasn’t aware. Although that seems to be restricted to core language UB and not include standard-library UB: https://stackoverflow.com/a/72494688/623763
I think it's worth pointing out that your statement is true by definition, perhaps not true by implementation in these cases. It's not like UB produces _random_ behavior, it's just not specified what compilers _should_ do in those cases.

Of course, cannot be relied upon.