Commit 57910f3a by Jason Merrill Committed by Jason Merrill

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
parent 41fa723a
2012-03-03 Jason Merrill <jason@redhat.com>
* class.c (add_method): Always build an OVERLOAD for using-decls.
* search.c (lookup_member): Handle getting an OVERLOAD for a
single function.
2012-03-02 Paolo Carlini <paolo.carlini@oracle.com> 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51989 PR c++/51989
......
...@@ -1117,9 +1117,13 @@ add_method (tree type, tree method, tree using_decl) ...@@ -1117,9 +1117,13 @@ add_method (tree type, tree method, tree using_decl)
return false; return false;
/* Add the new binding. */ /* Add the new binding. */
overload = build_overload (method, current_fns); if (using_decl)
if (using_decl && TREE_CODE (overload) == OVERLOAD) {
OVL_USED (overload) = true; overload = ovl_cons (method, current_fns);
OVL_USED (overload) = true;
}
else
overload = build_overload (method, current_fns);
if (conv_p) if (conv_p)
TYPE_HAS_CONVERSION (type) = 1; TYPE_HAS_CONVERSION (type) = 1;
......
...@@ -1250,10 +1250,12 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type, ...@@ -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 only the first call to "f" is valid. However, if the function is
static, we can check. */ static, we can check. */
if (rval && protect if (rval && protect
&& !really_overloaded_fn (rval) && !really_overloaded_fn (rval))
&& !(TREE_CODE (rval) == FUNCTION_DECL {
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (rval))) tree decl = is_overloaded_fn (rval) ? get_first_fn (rval) : rval;
perform_or_defer_access_check (basetype_path, rval, rval); if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
perform_or_defer_access_check (basetype_path, decl, decl);
}
if (errstr && protect) if (errstr && protect)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment