Keith-S-Thompson wrote:

Yes, the defined behavior is the same in C++ as it is in C.

Quoting a draft of the ISO C++ standard, section [stmt.switch], emphasis added:

> When the `switch` statement is executed, its condition is evaluated and 
> compared with each case constant. If
one of the case constants is equal to the value of the condition, control is 
passed to the statement following
the matched case label. If no case constant matches the condition, and if there 
is a `default` label, control
passes to the statement labeled by the `default` label. **If no case matches 
and if there is no `default` then none
of the statements in the switch is executed.**

https://github.com/llvm/llvm-project/pull/164709
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to