PR c++/72808
* decl.c (finish_enum_value_list): Call fixup_type_variants on
current_class_type after
insert_late_enum_def_into_classtype_sorted_fields.
* g++.dg/debug/pr72808.C: New test.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r242930
+2016-11-28 Jakub Jelinek <jakub@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/72808
+ * decl.c (finish_enum_value_list): Call fixup_type_variants on
+ current_class_type after
+ insert_late_enum_def_into_classtype_sorted_fields.
+
2016-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/77591
if (at_class_scope_p ()
&& COMPLETE_TYPE_P (current_class_type)
&& UNSCOPED_ENUM_P (enumtype))
- insert_late_enum_def_into_classtype_sorted_fields (enumtype,
- current_class_type);
+ {
+ insert_late_enum_def_into_classtype_sorted_fields (enumtype,
+ current_class_type);
+ fixup_type_variants (current_class_type);
+ }
/* Finish debugging output for this type. */
rest_of_type_compilation (enumtype, namespace_bindings_p ());
2016-11-28 Jakub Jelinek <jakub@redhat.com>
+ PR c++/72808
+ * g++.dg/debug/pr72808.C: New test.
+
PR rtl-optimization/78546
* gcc.dg/torture/pr78546-1.c: New test.
* gcc.dg/torture/pr78546-2.c: New test.
--- /dev/null
+// PR c++/72808
+// { dg-do compile }
+// { dg-options "-g -std=c++14" }
+
+struct A
+{
+ virtual void foo ();
+};
+
+struct B : A
+{
+ void foo ();
+ enum C : int;
+};
+
+enum B::C : int
+{
+ D
+};
+
+void
+B::foo ()
+{
+}