Well, you didn’t ask a question, but I feel obligated to tell you why the compiler is right and the code is valid (sorry, SO people):
if (true && false);
This is just an empty statement that is executed if the condition is met (in this case, it is not fulfilled due to && false, therefore, nothing happens (but nothing happens in any case)). The statement is empty because the closing bracket is immediately followed by a semicolon.
{ foo(); }
, . if, if. , . if.