From 03e707055891d5eaaf5dc9e850123bd2dd16ba38 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 3 Sep 1997 14:41:11 -0400 Subject: [PATCH] pt.c (type_unification): If strict and the function parm doesn't use template parms, just compare types. * pt.c (type_unification): If strict and the function parm doesn't use template parms, just compare types. From-SVN: r15062 --- gcc/cp/ChangeLog | 16 +++++++++++++++- gcc/cp/call.c | 2 ++ gcc/cp/pt.c | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b814f98cfc7..fe2bdbaf004 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,4 +1,9 @@ -Wed Sep 3 09:55:09 1997 Klaus Espenlaub (kespenla@student.informatik.uni-ulm.de) +Wed Sep 3 11:09:25 1997 Jason Merrill + + * pt.c (type_unification): If strict and the function parm doesn't + use template parms, just compare types. + +Wed Sep 3 10:35:49 1997 Klaus Espenlaub * method.c (build_overloaded_value): Replace direct call to the floating point emulator with REAL_VALUE_TO_DECIMAL macro. @@ -32,6 +37,15 @@ Tue Sep 2 10:27:08 1997 Richard Henderson Mon Sep 1 13:19:04 1997 Jason Merrill + * call.c (add_builtin_candidate): Add missing TREE_TYPE. + (compare_ics): Likewise. + From someone whose name I've lost (sorry). + + * call.c (joust): Warn about choosing one conversion op over + another because of 'this' argument when the other return type is + better. + (source_type): New fn. + * call.c (build_new_op): Strip leading REF_BIND from first operand to builtin operator. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index f2fe0380a93..b30f78fcd4a 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5781,6 +5781,8 @@ compare_ics (ics1, ics2) return 0; } +/* The source type for this standard conversion sequence. */ + static tree source_type (t) tree t; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4c79d948aa4..9ba46ac21b2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2664,11 +2664,38 @@ type_unification (tparms, targs, parms, args, nsubsts, subr, strict) if (arg == unknown_type_node) return 1; - if (! uses_template_parms (parm) - && TREE_CODE_CLASS (TREE_CODE (arg)) != 't') + /* Conversions will be performed on a function argument that + corresponds with a function parameter that contains only + non-deducible template parameters and explicitly specified + template parameters. */ + if (! uses_template_parms (parm)) { - if (can_convert_arg (parm, TREE_TYPE (arg), arg)) - continue; + tree type; + + if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't') + type = TREE_TYPE (arg); + else + { + type = arg; + arg = NULL_TREE; + } + + if (strict) + { + if (comptypes (parm, type, 1)) + continue; + } + else if (arg) + { + if (can_convert_arg (parm, type, arg)) + continue; + } + else + { + if (can_convert (parm, type)) + continue; + } + return 1; } -- 2.30.2