aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-07-19 01:36:50 +0000
committerJason Merrill <jason@gcc.gnu.org>2012-07-18 21:36:50 -0400
commit0e69fdf016311cb8570c43d8ec67e9d5cb2f2aeb (patch)
treed39c6d48e17f0d85751becc5f496f94737ead16b /gcc/cp/search.c
parent1936ace05cdfab4a25242e03c2d70921f00576cb (diff)
downloadgcc-0e69fdf016311cb8570c43d8ec67e9d5cb2f2aeb.zip
gcc-0e69fdf016311cb8570c43d8ec67e9d5cb2f2aeb.tar.gz
gcc-0e69fdf016311cb8570c43d8ec67e9d5cb2f2aeb.tar.bz2
DR 1170 PR c++/51213
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. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r189639
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 d112c05..048fdf3 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)