aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorTheodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>2000-08-12 03:30:06 +0200
committerJason Merrill <jason@gcc.gnu.org>2000-08-11 21:30:06 -0400
commit9845b52bfbbfe165725ff96f9802530bbc26d007 (patch)
tree07ee97d7f5e62d27b7e364b7b03c19c04a497ed7 /gcc/cp/decl2.c
parent3388651ce03f3e78e9342af592247d68b3f6fc16 (diff)
downloadgcc-9845b52bfbbfe165725ff96f9802530bbc26d007.zip
gcc-9845b52bfbbfe165725ff96f9802530bbc26d007.tar.gz
gcc-9845b52bfbbfe165725ff96f9802530bbc26d007.tar.bz2
decl2.c (add_function): Reorganize.
* decl2.c (add_function): Reorganize. (arg_assoc): Do not consider function template decls. From-SVN: r35653
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 7422be1..7bdd34c 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4791,10 +4791,11 @@ add_function (k, fn)
case. */
/* We must find only functions, or exactly one non-function. */
- if (k->functions && is_overloaded_fn (k->functions)
- && is_overloaded_fn (fn))
+ if (!k->functions)
+ k->functions = fn;
+ else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn))
k->functions = build_overload (fn, k->functions);
- else if (k->functions)
+ else
{
tree f1 = OVL_CURRENT (k->functions);
tree f2 = fn;
@@ -4807,8 +4808,7 @@ add_function (k, fn)
cp_error (" in call to `%D'", k->name);
return 1;
}
- else
- k->functions = fn;
+
return 0;
}
@@ -5063,9 +5063,15 @@ arg_assoc (k, n)
{
my_friendly_assert (TREE_CODE (n) == OVERLOAD, 980715);
- for (; n; n = OVL_CHAIN (n))
- if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n))))
- return 1;
+ for (; n; n = OVL_CHAIN (n))
+ {
+ /* Do not consider function template decls during Koenig lookup. */
+
+ tree fn = OVL_FUNCTION (n);
+ if (!DECL_FUNCTION_TEMPLATE_P (fn)
+ && arg_assoc_type (k, TREE_TYPE (fn)))
+ return 1;
+ }
}
return 0;