summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-04 00:53:30 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-04 00:53:30 +0000
commitce1c0a7d64dd5e1746bb33435c3b97f588c39d1a (patch)
treee0ec09d3761fb9852c3da23b28aefb03ba9de29a /gcc/cp/search.c
parent5471b163fa1c033b9db2e0cb4470e73f5993f5d3 (diff)
downloadgcc-ce1c0a7d64dd5e1746bb33435c3b97f588c39d1a.tar.gz
* 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
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c10
1 files changed, 6 insertions, 4 deletions
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)
{