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
This commit is contained in:
parent
30078c0a65
commit
0ffc468317
@ -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
|
||||
|
@ -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 "
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-01-17 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/59838
|
||||
* g++.dg/diagnostic/pr59838.C: New test.
|
||||
|
||||
2014-01-17 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/58346
|
||||
|
4
gcc/testsuite/g++.dg/diagnostic/pr59838.C
Normal file
4
gcc/testsuite/g++.dg/diagnostic/pr59838.C
Normal file
@ -0,0 +1,4 @@
|
||||
// PR c++/59838
|
||||
// { dg-do compile }
|
||||
|
||||
enum E { a, b = (E) a }; // { dg-error "conversion to incomplete type" }
|
Loading…
x
Reference in New Issue
Block a user