Backported from mainline
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.
* g++.dg/ext/int128-5.C: New test.
From-SVN: r248660
--- /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;