On 08/07/2014 06:49 AM, Paolo Carlini wrote:
+         if (ENUM_UNDERLYING_TYPE (enumtype))
+           value = perform_implicit_conversion_flags
+             (ENUM_UNDERLYING_TYPE (enumtype), value, tf_warning_or_error,
+              LOOKUP_IMPLICIT | LOOKUP_NO_NARROWING);

It seems like doing this unconditionally will suppress this error in some cases:

+             if (!int_fits_type_p (value, ENUM_UNDERLYING_TYPE (enumtype)))
+               error ("enumerator value %E is outside the range of underlying "
+                      "type %<%T%>", value, ENUM_UNDERLYING_TYPE (enumtype));

Maybe only do the conversion above if the expression isn't already an integer or enumeration?

Jason

Reply via email to