That's correct. The compiler makes an exception to the rule that prohibits unreachable code for if() statements to support conditional compilation. Otherwise, it is no different from while or do while.
Sri Sri, I just want to add that do.. while(false) works fine just like if(false). This is because the compiler knows that do ... while(false) gets executed at least once. for(;false gives compiler error just like while(false). This is because the code with in for loop never gets executed so compiler throws an error message stating that the code is not reachable. Even if the code in these cases is just a null statement represented by ;