[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-23 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Thanks @shafik , I wasn't aware! I will then close this PR and continue the discussion on Phab. https://github.com/llvm/llvm-project/pull/67170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/67170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-22 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This change is a lot more involved, this is on my list of things to do. See the discussion here: https://reviews.llvm.org/D150226 https://github.com/llvm/llvm-project/pull/67170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-22 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Not sure what happens with the failed job in CI, I rebased on latest trunk and ran the entire `ninja check-clang` suite and it passed successfully. Do I need some special CMake configuration flag to enable the failing test? About the patch itself - casting outside of range

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Casting an int into an enum is undefined behavior if the int is outside of the range of the enum. UB is not allowed in constant expressions, therefore the compiler must produce a hard error in that case. However, until now, the compiler p

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-22 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp created https://github.com/llvm/llvm-project/pull/67170 Casting an int into an enum is undefined behavior if the int is outside of the range of the enum. UB is not allowed in constant expressions, therefore the compiler must produce a hard error in that case.