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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #6)
> At least as far as this particular testcase goes, there's a warning from
> -Wuninitialized at least... if you initialize parentValue to EP_VAL2 like I
> think you intended, I can confirm that there are no warnings then, even
> after -Wenum-conversion was added for bug 78736. Since that was for just C,
> though, and this is C++, I guess that would make this bug 92159? But that
> was closed as WORKSFORME though...

Because as I said in comment 3 above, implicit conversions between distinct
enum types is ill-formed in C++. You don't need a warning, because it's already
an error.

I think this is just another case of a user not understanding how enums
actually work in C++. Values of the enum type which do not correspond to an
enumerator are still valid values of the type. Adding a warning for explicit
conversions between distinct types doesn't seem useful (as Manu said, you
should know what you're doing if you use an explicit cast to do conversions
that aren't allowed implicitly).

My inclination is INVALID or WONTFIX.

Reply via email to