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.