Commit 10cdabc8 by Jason Merrill Committed by Jason Merrill

re PR c++/53995 (Overload resolution fails with enum argument, says <anonymous enum>)

	PR c++/53995
	* decl.c (finish_enum_value_list): Only call
	insert_late_enum_def_into_classtype_sorted_fields in class scope.

From-SVN: r189598
parent 0d24465e
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.
PR c++/53989
* tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
to the list of variants.
......
......@@ -12392,7 +12392,7 @@ finish_enum_value_list (tree enumtype)
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 Kazu Hirata <kazu@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>
......
// 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); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment