Skip to content

Commit

Permalink
PR c++/72808
Browse files Browse the repository at this point in the history
	* 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/trunk@242930 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jakub committed Nov 28, 2016
1 parent 17a49f5 commit 70c32ff
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
8 changes: 8 additions & 0 deletions gcc/cp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
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
Expand Down
7 changes: 5 additions & 2 deletions gcc/cp/decl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14280,8 +14280,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 ());
Expand Down
3 changes: 3 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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.
Expand Down
24 changes: 24 additions & 0 deletions gcc/testsuite/g++.dg/debug/pr72808.C
Original file line number Diff line number Diff line change
@@ -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 ()
{
}

0 comments on commit 70c32ff

Please sign in to comment.