* decl.c (finish_enum_value_list): Only call
insert_late_enum_def_into_classtype_sorted_fields in class scope.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@189599
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-07-17 Jason Merrill <jason@redhat.com>
+ PR c++/53995
+ * decl.c (finish_enum_value_list): Only call
+ insert_late_enum_def_into_classtype_sorted_fields in class scope.
+
+2012-07-17 Jason Merrill <jason@redhat.com>
+
PR c++/53989
* tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
to the list of variants.
for (t = TYPE_MAIN_VARIANT (enumtype); t; t = TYPE_NEXT_VARIANT (t))
TYPE_VALUES (t) = TYPE_VALUES (enumtype);
- if (current_class_type
+ if (at_class_scope_p ()
&& COMPLETE_TYPE_P (current_class_type)
&& UNSCOPED_ENUM_P (enumtype))
insert_late_enum_def_into_classtype_sorted_fields (enumtype,
2012-07-17 Jason Merrill <jason@redhat.com>
+ PR c++/53995
+ * g++.dg/parse/enum9.C: New.
+
+2012-07-17 Jason Merrill <jason@redhat.com>
+
PR c++/53989
* g++.dg/template/array23.C: New.
--- /dev/null
+// PR c++/53995
+
+enum E1 { e };
+void f(E1);
+
+struct A {
+ int i1,i2,i3,i4,i5,i6,i7,i8,i9,i10;
+ void g();
+ void h();
+};
+
+void A::g() { enum E2 { e }; }
+void A::h() { f(e); }