https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125020

            Bug ID: 125020
           Summary: [doc] -Wenum-conversion is available for C++/ObjC++
                    also
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: heiko at hexco dot de
  Target Milestone: ---

The documentation (gcc 16.0) states

-Wextra This enables some extra warning flags that are not enabled by -Wall.
(This
option used to be called -W. The older name is still supported, but the newer
name is more descriptive.)
...
-Wenum-conversion (only for C/ObjC)

and later

-Wenum-conversion
Warn when a value of enumerated type is implicitly converted to a different
enumerated type. This warning is enabled by -Wextra in C.

But this warning is also available for C++/ObjC++, although being used for
different messages.

For example see test cases
gcc/testsuite/gcc.dg/Wenum-conversion.c
"implicit conversion from .enum Y. to .enum X."

gcc/testsuite/g++.dg/cpp2a/enum-conv3.C
"enumerated and non-enumerated type in conditional expression"

Reply via email to