Commit fa531100 by Mark Mitchell Committed by Mark Mitchell

re PR c++/11786 (operator() call on variable in other namespace not recognized)

	PR c++/11786
	* decl2.c (add_function): Do not complain about seeing the same
	non-function twice.
	* semantics.c (perform_koenig_lookup): Improve documentation.

	PR c++/11786
	* g++.dg/lookup/koenig2.C: New test.

From-SVN: r71213
parent c4bb110a
2003-09-08 Mark Mitchell <mark@codesourcery.com>
PR c++/11786
* decl2.c (add_function): Do not complain about seeing the same
non-function twice.
* semantics.c (perform_koenig_lookup): Improve documentation.
PR c++/5296
* pt.c (try_one_overload): Add addr_p parameter.
(resolve_overloaded_unification): Pass it.
......
......@@ -3505,6 +3505,8 @@ add_function (struct arg_lookup *k, tree fn)
/* We must find only functions, or exactly one non-function. */
if (!k->functions)
k->functions = fn;
else if (fn == k->functions)
;
else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn))
k->functions = build_overload (fn, k->functions);
else
......
......@@ -1534,8 +1534,9 @@ finish_stmt_expr (tree rtl_expr, bool has_no_scope)
}
/* Perform Koenig lookup. FN is the postfix-expression representing
the call; ARGS are the arguments to the call. Returns the
functions to be considered by overload resolution. */
the function (or functions) to call; ARGS are the arguments to the
call. Returns the functions to be considered by overload
resolution. */
tree
perform_koenig_lookup (tree fn, tree args)
......
2003-09-08 Mark Mitchell <mark@codesourcery.com>
PR c++/11786
* g++.dg/lookup/koenig2.C: New test.
PR c++/5296
* g++.dg/rtti/typeid2.C: New test.
......
struct S
{
template <typename T> void operator() (T) {}
};
namespace N
{
S s;
struct A {} a;
}
using N::s;
void f () { s(N::a); }
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