4 ms·
Interestingly C++ makes this UB. > Otherwise, flowing off the end of a function other than main or a coroutine ([dcl.fct.def.coroutine]) results in undefined b
by planede 4y ago
Interestingly C++ makes this UB.
> Otherwise, flowing off the end of a function other than main or a coroutine ([dcl.fct.def.coroutine]) results in undefined behavior.
https://timsong-cpp.github.io/cppwp/n4868/stmt.return#2.sentence-9 https://timsong-cpp.github.io/cppwp/n4868/stmt.return#2.sent...
edit:
This also manifests in compiler optimizations, at least in gcc
https://godbolt.org/z/GhxjdWqGb https://godbolt.org/z/GhxjdWqGb