I've read already a couple times (e.g. here Compiler: What if condition is always true / false) that any decent c++ compiler will opt-out something like
if(false)
{
...
}
But what if there is an intentional jump into this if(false)
block. I'm having something like this in mind
#include <iostream>
void func(int part){
switch (part) {
case 0:{
if(false)
case 1:{std::cout << "hello" << std::endl;}
break;
}
default:
break;
}
}
int main()
{
func(0);
func(1);
return 0;
}
Is any decent c++ compiler going to respect the jump or will there eventually going to be some problems with opting-out?