Y
Hacker News
new
|
ask
|
show
|
jobs
by
layer8
1168 days ago
(nevermind)
2 comments
jcelerier
1168 days ago
Successful compilation of UB is explicitly disallowed by the standard in a constexpr context
link
layer8
1168 days ago
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
link
jvanderbot
1168 days ago
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.
link