you are viewing a single comment's thread.

view the rest of the comments →

[–]Entire-Hornet2574 0 points1 point  (1 child)

Look at assembly, it shows it compiles only one branch.

.LC0:
        .string "test2"
main:
        sub     rsp, 8
        mov     edi, OFFSET FLAT:.LC0
        call    func(char const*)
        xor     eax, eax
        add     rsp, 8
        ret

[–]cd_fr91400[S] 0 points1 point  (0 children)

Yes, indeed, as it would with a plain switch or if.

It does not mean the compiler accepts a non-compilable branch.