[all-commits] [llvm/llvm-project] 5bbe15: Cap IntRange::Width to MaxWidth (#145356)

Akira Hatanaka via All-commits all-commits at lists.llvm.org
Thu Jun 26 08:03:55 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bbe1536dfa6f1dce8737e466c209c553d614e50
      https://github.com/llvm/llvm-project/commit/5bbe1536dfa6f1dce8737e466c209c553d614e50
  Author: Akira Hatanaka <ahatanak at gmail.com>
  Date:   2025-06-26 (Thu, 26 Jun 2025)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/implicit-int-conversion-on-int.c

  Log Message:
  -----------
  Cap IntRange::Width to MaxWidth (#145356)

This commit addresses a fallout introduced by #126846.

Previously, TryGetExprRange would return an IntRange that has an active
range exceeding the maximum representable range for the expression's
underlying type. This led to clang erroneously issuing warnings about
implicit conversions losing integer precision.

This commit fixes the bug by capping IntRange::Width to MaxWidth.

rdar://149444029



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