diff options
author | Jason Merrill <jason@redhat.com> | 2012-07-17 22:47:59 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-07-17 22:47:59 -0400 |
commit | 10cdabc89f0e2ea798595f3b5921d966e187e694 (patch) | |
tree | 6a8b5a193624e678d61c8b23b7344110c106acfd /gcc/cp | |
parent | 0d24465ea95a161133e38727b4d4d992b5ac0921 (diff) | |
download | gcc-10cdabc89f0e2ea798595f3b5921d966e187e694.zip gcc-10cdabc89f0e2ea798595f3b5921d966e187e694.tar.gz gcc-10cdabc89f0e2ea798595f3b5921d966e187e694.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c1465cc..ef4e8ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 84b78f6..8a3163a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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, |