[all-commits] [llvm/llvm-project] 5a20b7: [ADT] Simplify ResolveUnderlyingType (NFC) (#164114)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat Oct 18 17:51:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a20b72fce52244e7c2de1c69c6cea36e00d8bb5
      https://github.com/llvm/llvm-project/commit/5a20b72fce52244e7c2de1c69c6cea36e00d8bb5
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M llvm/include/llvm/ADT/Bitfields.h

  Log Message:
  -----------
  [ADT] Simplify ResolveUnderlyingType (NFC) (#164114)

We have three implementations of ResolveUnderlyingType:

- enum
- bool
- neither

This patch combines the latter two with std::conditional_t.

Without this patch, we use "void" to trigger a compilation failure
downstream when sizeof(bool) != 1, which is not very friendly.  This
patch instead uses static_assert to catch the case where the user
chooses to use bool but sizeof(bool) != 1.



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