3 ms·
But this example isn't adding a constraint. The if statement is getting optimised away???
by benj111 4y ago
But this example isn't adding a constraint. The if statement is getting optimised away???
- masklinn 4y agoIt is adding a constraint. The constraint is that argc can’t be smaller than 2. This is a literal “can’t”, as far as the compiler is concerned it’s a logical impossibility. The branch containing the unreachable() obviously gets removed but the compiler then propagates the constraint (the condition for that illegal branch), and can prune any other path where `argc <= 2` upstream and downstream, as they are dead code per the constraint.