From ce1c0a7d64dd5e1746bb33435c3b97f588c39d1a Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 4 Mar 2012 00:53:30 +0000 Subject: * class.c (add_method): Always build an OVERLOAD for using-decls. * search.c (lookup_member): Handle getting an OVERLOAD for a single function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184873 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/search.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/cp/search.c') diff --git a/gcc/cp/search.c b/gcc/cp/search.c index e48dcec0589..a1f8a3db173 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1250,10 +1250,12 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type, only the first call to "f" is valid. However, if the function is static, we can check. */ if (rval && protect - && !really_overloaded_fn (rval) - && !(TREE_CODE (rval) == FUNCTION_DECL - && DECL_NONSTATIC_MEMBER_FUNCTION_P (rval))) - perform_or_defer_access_check (basetype_path, rval, rval); + && !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 (errstr && protect) { -- cgit v1.2.1