I stumbled upon some syntactically weird looking code recently when porting a c++ project from Windows to Linux.
if ( isObjectNear( objectPos, objectLength ) + .025, 0.125 ) { ... }"
In this if-statement a parenthesis was misplaced causing the statement to consist of two expressions separated by the comma. The boolean "isObjectNear(..)" method had default parameters which allowed the call to be made using Microsoft's compiler despite the obvious mistake.
It was when building on Linux with GCC the problem was discovered giving the error message:
error: value computed is not used [-Werror=unused-value]
The code in my case is more interesting than relevant to the question and the following code serve the purpose of the question more clearly with the return-value in comments:
if ( true, 0.5 ) ... // returns true since 0.5 > 0 ( 0 == false)
if ( true, 0.0 ) ... // returns false
if ( 1.0, false ) ... // returns false
if ( true, false, false, ..., true ) ... // returns true
So back to the question "Why is a if-statement with comma-separated expressions allowed by Microsoft's C/C++ compiler?"