const int a = 10;
if(a == 10) {
//Do X
} else {
//Do Y
}
I would have thought that in this case, the code would be rewritten to:
const int a = 10;
//Do X
Because we know at compile-time which if branch will execute, every time.
However, this is not the case during debugging. Is this not at all as trivial as I thought for the compiler? Or does it actually happen, but not when debugging information is written?