[clang] [clang] Check constexpr int->enum conversions consistently. (PR #143034)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 4 09:45:38 PDT 2025


efriedma-quic wrote:

@tstellar Yes, the error message there looks correct.  The simplest fix for most code is to use a fixed-width enum (`enum : int { kUnknown = 3, kMaxValue = kUnknown };`).

gcc doesn't currently diagnose such conversions.

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


More information about the cfe-commits mailing list