Ö
Öö Tiib
So presumably a Java compiler has to make sure there is no such path.
Java and C# compilers sometimes analyse such things deeply but
sometimes seemingly add run-time checks that throw. Amount of
undefined behaviors is very low in these languages.
C++ may do the same, but then it may cause loss of efficiency of
compiler if analyses deeply or resulting executable if run-time checks
are added. I already imagine protests.
Alteratively C++ may add an expression type (some "never") that
guarantees (and specifies) that function (like exit) or expression
(like throw) never returns. It might aid optimizations too on some
cases. Again it may cause some things not backward compatible so there
will be protests. IOW it is hard to get rid of undefined behavior.
Currently there are plenty of code where one compiler warns about "non-
returning control path" if dummy is missing and other warns about "un-
reachable code" when dummy is present. The diagnostics can be silenced
by reorganizing code, but not always.
If lambdas are not warning on VC 10 then ... aren't you one of
architects of the very compiler there?