+2017-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79896
+ * decl.c (finish_enum_value_list): If value is error_mark_node,
+ don't copy it and change its type.
+ * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
+ of CONST_DECL is error_mark_node.
+
2017-03-09 Marek Polacek <polacek@redhat.com>
PR c++/79900 - ICE in strip_typedefs
input_location = saved_location;
/* Do not clobber shared ints. */
- value = copy_node (value);
+ if (value != error_mark_node)
+ {
+ value = copy_node (value);
- TREE_TYPE (value) = enumtype;
+ TREE_TYPE (value) = enumtype;
+ }
DECL_INITIAL (decl) = value;
}
init = DECL_INITIAL (decl);
if (init == error_mark_node)
{
- if (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
+ if (TREE_CODE (decl) == CONST_DECL
+ || DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
/* Treat the error as a constant to avoid cascading errors on
excessively recursive template instantiation (c++/9335). */
return init;
+2017-03-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79896
+ * g++.dg/ext/int128-5.C: New test.
+
2017-03-10 Segher Boessenkool <segher@kernel.crashing.org>
PR testsuite/79356
--- /dev/null
+// PR c++/79896
+// { dg-do compile { target { ilp32 && { ! int128 } } } }
+// { dg-options "" }
+
+enum E
+{
+ e1 = 0xffffffffffffffffULL,
+ e2, // { dg-error "overflow in enumeration values" }
+ e3
+} e = e3;