We could enable "-Wparentheses" for this. It also nicely catches some other issues like: if (x = 0) { } forcing one to write if ((x = 0)) { } if you really meant the assignment.