diff options
author | Marek Polacek <polacek@redhat.com> | 2014-01-17 15:23:17 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-01-17 15:23:17 +0000 |
commit | 0ffc4683170aa3cdb3c244745f7d52ae798da520 (patch) | |
tree | 184559a8970dd5712cf703d6eda33582fec25cb7 /gcc/cp | |
parent | 30078c0a6521519cd18090edb554c62e8d9c1a8a (diff) | |
download | gcc-0ffc4683170aa3cdb3c244745f7d52ae798da520.zip gcc-0ffc4683170aa3cdb3c244745f7d52ae798da520.tar.gz gcc-0ffc4683170aa3cdb3c244745f7d52ae798da520.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 848c406..66896d9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-01-17 Marek Polacek <polacek@redhat.com> + + PR c++/59838 + * cvt.c (ocp_convert): Don't segfault on non-existing + ENUM_UNDERLYING_TYPE. + 2014-01-16 Jason Merrill <jason@redhat.com> PR c++/59821 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 " |