Commit 3693f266 by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/39987 (Rejects default argument that is a template via access failure)

2009-08-04  Dodji Seketeli  <dodji@redhat.com>

gcc/cp/ChangeLog:
	PR c++/39987
	* pt.c (tsubst_default_argument): Let access checks of the
	default argument happen in the context of the current function.

gcc/testsuite/ChangeLog:
	PR c++/39987
	* g++.dg/overload/defarg4.C: New test.

From-SVN: r150467
parent 4eb0668e
2009-08-04 Dodji Seketeli <dodji@redhat.com>
PR c++/39987
* pt.c (tsubst_default_argument): Let access checks of the
default argument happen in the context of the current function.
2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org> 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/16696 PR c++/16696
......
...@@ -8253,11 +8253,11 @@ tsubst_default_argument (tree fn, tree type, tree arg) ...@@ -8253,11 +8253,11 @@ tsubst_default_argument (tree fn, tree type, tree arg)
cp_function_chain->x_current_class_ref = saved_class_ref; cp_function_chain->x_current_class_ref = saved_class_ref;
} }
pop_access_scope (fn);
/* Make sure the default argument is reasonable. */ /* Make sure the default argument is reasonable. */
arg = check_default_argument (type, arg); arg = check_default_argument (type, arg);
pop_access_scope (fn);
return arg; return arg;
} }
......
2009-08-04 Dodji Seketeli <dodji@redhat.com>
PR c++/39987
* g++.dg/overload/defarg4.C: New test.
2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org> 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/16696 PR c++/16696
......
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