[all-commits] [llvm/llvm-project] f61789: [ADT] Add `DefaultUnreachable("msg")` to StringSwi...

Jakub Kuderski via All-commits all-commits at lists.llvm.org
Sun Oct 5 03:28:20 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f61789f5f6788322d8864f2c32021fd552f3f7b4
      https://github.com/llvm/llvm-project/commit/f61789f5f6788322d8864f2c32021fd552f3f7b4
  Author: Jakub Kuderski <jakub at nod-labs.com>
  Date:   2025-10-05 (Sun, 05 Oct 2025)

  Changed paths:
    M llvm/include/llvm/ADT/StringSwitch.h
    M llvm/unittests/ADT/StringSwitchTest.cpp

  Log Message:
  -----------
  [ADT] Add `DefaultUnreachable("msg")` to StringSwitch (#161976)

Similar to TypeSwitch (#161970), allow for explicit unreachable default
case with a custom error message on unhandled cases.

StringSwitch already allowed for checking if any of the cases matched
with the conversion operator, but `DefaultUnreachable` is more explicit
and allows for a custom message.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list