[Bug c++/59838] ICE with an enum using an incomplete type
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 17 09:55:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59838
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This seems to fix it.
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -753,6 +753,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags,
unspecified. */
if ((complain & tf_warning)
&& TREE_CODE (e) == INTEGER_CST
+ && ENUM_UNDERLYING_TYPE (type)
&& !int_fits_type_p (e, ENUM_UNDERLYING_TYPE (type)))
warning_at (loc, OPT_Wconversion,
"the result of the conversion is unspecified because "
More information about the Gcc-bugs
mailing list