aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-03-03 19:53:30 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-03-03 19:53:30 -0500
commit57910f3a9a81e9ad122a814255197f6f24c6af08 (patch)
treee0ec09d3761fb9852c3da23b28aefb03ba9de29a /gcc/cp/search.c
parent41fa723a78802569d26cf7b1043f45984bf9cc9d (diff)
downloadgcc-57910f3a9a81e9ad122a814255197f6f24c6af08.zip
gcc-57910f3a9a81e9ad122a814255197f6f24c6af08.tar.gz
gcc-57910f3a9a81e9ad122a814255197f6f24c6af08.tar.bz2
class.c (add_method): Always build an OVERLOAD for using-decls.
* class.c (add_method): Always build an OVERLOAD for using-decls. * search.c (lookup_member): Handle getting an OVERLOAD for a single function. From-SVN: r184873
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 e48dcec..a1f8a3d 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)
{