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: r150468
This commit is contained in:
Dodji Seketeli 2009-08-04 19:59:48 +00:00 committed by Dodji Seketeli
parent b02ee3cdb2
commit 0a41d310ba
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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 Dodji Seketeli <dodji@redhat.com>
PR debug/39706

View File

@ -8007,11 +8007,11 @@ tsubst_default_argument (tree fn, tree type, tree arg)
cp_function_chain->x_current_class_ref = saved_class_ref;
}
pop_access_scope (fn);
/* Make sure the default argument is reasonable. */
arg = check_default_argument (type, arg);
pop_access_scope (fn);
return arg;
}

View File

@ -1,3 +1,8 @@
2009-08-04 Dodji Seketeli <dodji@redhat.com>
PR c++/39987
* g++.dg/overload/defarg4.C: New test.
2009-08-04 Dodji Seketeli <dodji@redhat.com>
PR debug/39706