it will process and compile the language much easier
I donβt understand how to do this. Why is it easier to analyze and compile i < i > i if you need to issue a diagnosis than you need to analyze it, if you are allowed to do everything that is damn good, please, provided that the emitted code has no side effects?
The Java compiler forbids unreachable code (as opposed to code without an effect), which is a mixed blessing for the programmer and requires a little extra work from the compiler than the C ++ compiler requires (basic lock analysis). Should C ++ forbid unreachable code? Probably no. Despite the fact that C ++ compilers, of course, do enough optimization to detect unreachable base blocks, in some cases they can do too much. Should if (foo) { ...} be an illegal unreachable block if foo is a false compile-time constant? What if this is not a compile-time constant, but the optimizer figured out how to calculate the value if it should be legal, and the compiler needs to understand that the reason for its removal is implementation-specific so as not to give an error? More special cases.
someone really doesn't have a program with expressions without side effects in them
Freights. For example, if NDEBUG true, then assert expands to void with no effect. So even more special cases are needed in the compiler to allow some useless expressions, but not others.
The rationale, I believe, is that if it is not used for anything, then (a) the compilers will ultimately throw warnings for things like if (foo) assert(bar); , and (b) such a code would be legal in release, but not in debugging, which just confuses:
assert(foo)
things like the most unpleasant analysis
That is why he called "annoyance." This is a backward compatibility issue. If C ++ now changes the meaning of these annoying parses, the value of the existing code will change. Not as much existing code as you specify, but the C ++ committee takes a pretty solid line for backward compatibility. If you need a language that changes every five minutes, use Perl; -)
Anyway, it's too late. Even if we had some idea that the C ++ 0x committee missed why some function should be deleted or incompatibly changed, they will not break anything in the FCD if the FCD is not completely wrong.
Please note that for all your sentences, any compiler can give a warning for them (in fact, I do not understand what your problem is with the second example, but, of course, for useless expressions and for annoying analyzes in function bodies). If you are right that no one does it intentionally, warnings will not cause harm. If you are mistaken that no one is doing this on purpose, your reported case for correcting them is incorrect. Warnings in popular compilers can pave the way for function removal, especially since the author standard is largely compiled by compiler authors. The fact that we do not always receive warnings for these things tells me that there is more than you think.