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

Carlos Galvez via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 22 11:50:55 PDT 2023


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 of enum is only UB since C++17 - before that it's unspecified. Do we want the error to throw always (this patch), or only in C++17 and on?

I started to put up a patch to filter this to only C++17, but then I thought: if the compiler is catching something bad, and it can warn about it, why shouldn't it?

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


More information about the cfe-commits mailing list