PR c++/37971
* class.c (resolve_address_of_overloaded_function): Check
accessibility of member functions unless FLAGS indicates
otherwise.
* call.c (standard_conversion): Adjust flags passed to
instantiate_type.
(convert_default_arg): Do not perform access checks.
* cp-tree.h (tsubst_flags_t): Add tf_no_access_control.
PR c++/37971
* g++.dg/overload/defarg2.C: New test.
* g++.dg/overload/defarg3.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142628
138bc75d-0d04-0410-961f-
82ee72b054a4