This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible enum comparison warning
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 May 2012 16:29:08 +0000
- Subject: [Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible enum comparison warning
- Auto-submitted: auto-generated
- References: <bug-53524-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53524
--- Comment #8 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-05-30 16:29:08 UTC ---
(In reply to comment #6)
> The warnings are an unintended effect of my fix for PR16603.
So, before your fix, same_type_p was returning true?
enum { e1 = -1 };
enum { e2 = -1 };
int j;
void foo(void) {
j = 0 ? e1 : e2;
}
g++ 4.3.2
tt.cc:6: warning: enumeral mismatch in conditional expression: â<anonymous
enum>â vs â<anonymous enum>â
So, the warning is intended, and the fact that we did not warn before was a
bug. However, it is not clear to me how this code can be dangerous. But the
warning is very very old.
r29056 | nathan | 1999-09-02 11:21:42 +0200 (Thu, 02 Sep 1999) | 4 lines
* call.c (build_conditional_expr): Warn on enum mismatches.
(convert_arg_to_ellipsis): Move non-pod check to after
conversion.