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
This commit is contained in:
parent
0d24465ea9
commit
10cdabc89f
4 changed files with 23 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
|||
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,
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
|
|
13
gcc/testsuite/g++.dg/parse/enum9.C
Normal file
13
gcc/testsuite/g++.dg/parse/enum9.C
Normal file
|
@ -0,0 +1,13 @@
|
|||
// 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); }
|
Loading…
Add table
Reference in a new issue