From 0ffc4683170aa3cdb3c244745f7d52ae798da520 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 17 Jan 2014 15:23:17 +0000 Subject: re PR c++/59838 (ICE with an enum using an incomplete type) PR c++/59838 cp/ * cvt.c (ocp_convert): Don't segfault on non-existing ENUM_UNDERLYING_TYPE. testsuite/ * g++.dg/diagnostic/pr59838.C: New test. From-SVN: r206716 --- gcc/cp/cvt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/cp/cvt.c') diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index df208cc..c2cdf83 100644 --- 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 " -- cgit v1.1