aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/semantics.c5
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/lookup/koenig2.C15
5 files changed, 28 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 13a5c55..c02e8d1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
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.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 209f793..4004c8c 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 8b765ef..e7392c0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bf04edf..3d9d367 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
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.
diff --git a/gcc/testsuite/g++.dg/lookup/koenig2.C b/gcc/testsuite/g++.dg/lookup/koenig2.C
new file mode 100644
index 0000000..04f9525
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/koenig2.C
@@ -0,0 +1,15 @@
+struct S
+{
+ template <typename T> void operator() (T) {}
+};
+
+namespace N
+{
+ S s;
+ struct A {} a;
+}
+
+using N::s;
+
+void f () { s(N::a); }
+