[Lldb-commits] [lldb] [lldb] Fix GCC's `-Wreturn-type` warnings (PR #127974)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 20 02:06:45 PST 2025


https://github.com/labath commented:

The default clause prevents the "uncovered enumerator" from firing is a new value is added to the enum (and it's actually against the [coding standards](https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations)). The recommended solution is to place llvm_unreachable after the switch [like so](https://github.com/llvm/llvm-project/blob/6e047a5ab42698165a4746ef681396fab1698327/llvm/include/llvm/IR/GlobalValue.h#L160)

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


More information about the lldb-commits mailing list