summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-07 22:59:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-07 22:59:28 +0000
commit83e6e9b7007b09f5a3a2581307a0afe00bfd7edf (patch)
treebec2ef716cbd68ad32f0fab1f3e4394d49396661
parent350199c25f73f609087d86c8cc5cacd34c86d0f3 (diff)
downloadgcc-83e6e9b7007b09f5a3a2581307a0afe00bfd7edf.tar.gz
Backported from mainline
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. * g++.dg/debug/pr72808.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243412 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c7
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/debug/pr72808.C24
4 files changed, 40 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3fb964d4aad..1233ec1f779 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -2,6 +2,14 @@
Backported from mainline
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
* typeck.c (maybe_warn_about_returning_address_of_local): Optimize
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 07870d189e5..30a8c5a7171 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13504,8 +13504,11 @@ finish_enum_value_list (tree enumtype)
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 ());
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0ebe3e8d216..477ef64f3a6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -3,6 +3,9 @@
Backported from mainline
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.
diff --git a/gcc/testsuite/g++.dg/debug/pr72808.C b/gcc/testsuite/g++.dg/debug/pr72808.C
new file mode 100644
index 00000000000..7e4688c3e70
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr72808.C
@@ -0,0 +1,24 @@
+// 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 ()
+{
+}