I do not know the specific rules that can help in this situation, but let's use the priorities of operations.
Using the rules of priorities, we can divide the computation of the second expression on several steps
1 f(2) && b => expr1
2 expr1 = f(4) => expr2
3 a = expr2
Obvious that in Step 2 we get an incorrect situation - on the left side of = is rvalue - temporary object, which can not be assigning by any value. I assume that syntactic analyzer break the rules of priority evaluation of expressions when encounter such situations.
More details on the calculations of expressions can be found here