summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-19 01:36:50 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-19 01:36:50 +0000
commiteb833cbe81af8557958673c11a44cc629b79c588 (patch)
treed39c6d48e17f0d85751becc5f496f94737ead16b /gcc/cp/search.c
parentd70a13f878ee94b5e3b70307821fca3cd8c855e4 (diff)
downloadgcc-eb833cbe81af8557958673c11a44cc629b79c588.tar.gz
DR 1170
PR c++/51213 * semantics.c (perform_access_checks): Add complain parm, return bool. (perform_deferred_access_checks): Likewise. (perform_or_defer_access_check): Likewise. (speculative_access_check): Remove. * call.c (enforce_access): Add complain parm, return bool. * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers. * search.c: Adjust callers. * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro. (FNDECL_RECHECK_ACCESS_P): New macro. * method.c (synthesized_method_walk): Stop deferring access checks. * pt.c (recheck_decl_substitution): New. (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index d112c05713c..048fdf3270a 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1254,8 +1254,10 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type,
&& !really_overloaded_fn (rval))
{
tree decl = is_overloaded_fn (rval) ? get_first_fn (rval) : rval;
- if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
- perform_or_defer_access_check (basetype_path, decl, decl);
+ if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && !perform_or_defer_access_check (basetype_path, decl, decl,
+ complain))
+ rval = error_mark_node;
}
if (errstr && protect)