[clang] [clang] Add unreachable after fully covered switches, avoid GCC warnings. NFC. (PR #159330)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 17 08:54:37 PDT 2025


mstorsjo wrote:

> I'm not opposed to this change but we might want to report that to GCC, it is a false positive

GCC considers that enums potentially can have any representable value - this is a known longtime difference between GCC and Clang to the point that we have it mentioned in our [CodingStandards](https://github.com/llvm/llvm-project/blob/main/llvm/docs/CodingStandards.rst#don-t-use-default-labels-in-fully-covered-switches-over-enumerations).

https://github.com/llvm/llvm-project/pull/159330


More information about the cfe-commits mailing list