diff options
author | Jason Merrill <jason@redhat.com> | 2011-06-07 17:53:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-06-07 17:53:53 -0400 |
commit | 783c26ae6798141f9822f52b45b24abf685c0afc (patch) | |
tree | e26b3f929c80222a1a34fa5c3b8f3cfe3873a9da | |
parent | 6976ae513f494a12d8dbc4c80d2b0dcd85a5c7c0 (diff) | |
download | gcc-783c26ae6798141f9822f52b45b24abf685c0afc.zip gcc-783c26ae6798141f9822f52b45b24abf685c0afc.tar.gz gcc-783c26ae6798141f9822f52b45b24abf685c0afc.tar.bz2 |
pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope.
* pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope.
(fn_type_unification): Don't call push_deduction_access_scope here.
From-SVN: r174771
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ba3fd1a..641bf73 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Jason Merrill <jason@redhat.com> + + * pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope. + (fn_type_unification): Don't call push_deduction_access_scope here. + 2011-06-06 Jason Merrill <jason@redhat.com> PR c++/48780 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c955777..ce43d8a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -111,6 +111,8 @@ static GTY(()) VEC(tree,gc) *canonical_template_parms; static void push_access_scope (tree); static void pop_access_scope (tree); +static void push_deduction_access_scope (tree); +static void pop_deduction_access_scope (tree); static bool resolve_overloaded_unification (tree, tree, tree, tree, unification_kind_t, int); static int try_one_overload (tree, tree, tree, tree, tree, @@ -13633,7 +13635,12 @@ deduction_tsubst_fntype (tree fn, tree targs) /* We don't need to worry about this in C++98. */ if (cxx_dialect < cxx0x) - return tsubst (fntype, targs, tf_none, NULL_TREE); + { + push_deduction_access_scope (fn); + r = tsubst (fntype, targs, tf_none, NULL_TREE); + pop_deduction_access_scope (fn); + return r; + } /* If we're seeing a lot of recursion, switch over to a hash table. The constant 40 is fairly arbitrary. */ @@ -13698,7 +13705,9 @@ deduction_tsubst_fntype (tree fn, tree targs) VEC_safe_push (spec_entry, gc, current_deduction_vec, &elt); } + push_deduction_access_scope (fn); r = tsubst (fntype, targs, tf_none, NULL_TREE); + pop_deduction_access_scope (fn); /* After doing the substitution, make sure we didn't hit it again. Note that we might have switched to a hash table during tsubst. */ @@ -14017,9 +14026,7 @@ fn_type_unification (tree fn, incomplete = NUM_TMPL_ARGS (explicit_targs) != NUM_TMPL_ARGS (targs); processing_template_decl += incomplete; - push_deduction_access_scope (fn); fntype = deduction_tsubst_fntype (fn, converted_args); - pop_deduction_access_scope (fn); processing_template_decl -= incomplete; if (fntype == error_mark_node) @@ -14090,10 +14097,7 @@ fn_type_unification (tree fn, substitution results in an invalid type, as described above, type deduction fails. */ { - tree substed; - push_deduction_access_scope (fn); - substed = deduction_tsubst_fntype (fn, targs); - pop_deduction_access_scope (fn); + tree substed = deduction_tsubst_fntype (fn, targs); if (substed == error_mark_node) return 1; |