[all-commits] [llvm/llvm-project] 3b7ba2: [C23] No longer assert on huge enumerator values (...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Feb 20 08:58:16 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b7ba2482e2c1b9b240664a247db55d253a3e1f5
      https://github.com/llvm/llvm-project/commit/3b7ba2482e2c1b9b240664a247db55d253a3e1f5
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2024-02-20 (Tue, 20 Feb 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/Sema/enum.c

  Log Message:
  -----------
  [C23] No longer assert on huge enumerator values (#81760)

C23 added the wb and uwb suffixes to generate a bit-precise integer
value. These values can be larger than what is representable in intmax_t
or uintmax_t.

We were asserting that an enumerator constant could not have a value
larger than unsigned long long but that's now a possibility. This patch
turns the assertion into a "value too large" diagnostic.

Note, we do not yet implement WG14 N3029 and so the behavior of this
patch will cause the enumerator to be cast to unsigned long long, but
this behavior may change in the future. GCC selects __uint128_t as the
underlying type for such an enumeration and we may want to match that
behavior in the future. This patch has several FIXME comments related to
this and the release notes call out the possibility of a change in
behavior in the future.

Fixes https://github.com/llvm/llvm-project/issues/69352



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