[clang] [clang] Diagnose invalid/unavailable operator overloads for scoped flag_enums (PR #218290)

Matthias Wippich via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 23 17:13:47 PDT 2026


================
@@ -6721,6 +6721,9 @@ def ext_enumerator_increment_too_large : ExtWarn<
 def warn_flag_enum_constant_out_of_range : Warning<
   "enumeration value %0 is out of range of flags in enumeration type %1">,
   InGroup<FlagEnum>;
+def warn_flag_enum_operator : Warning<
+  "%1 is %select{|not available|ambiguous|deleted}2 for flag-like enumeration type %0%select{|: %4}3">,
+  InGroup<FlagEnum>;
----------------
Tsche wrote:

Should this be a different warning group or is it fine to use `-Wflag-enum` for this?

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


More information about the cfe-commits mailing list