diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-04 00:53:30 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-04 00:53:30 +0000 |
commit | ce1c0a7d64dd5e1746bb33435c3b97f588c39d1a (patch) | |
tree | e0ec09d3761fb9852c3da23b28aefb03ba9de29a /gcc/cp/search.c | |
parent | 5471b163fa1c033b9db2e0cb4470e73f5993f5d3 (diff) | |
download | gcc-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.c | 10 |
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) { |