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
This commit is contained in:
Jason Merrill 1997-09-03 14:41:11 -04:00
parent 57163df067
commit 03e7070558
3 changed files with 48 additions and 5 deletions

View File

@ -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 <jason@yorick.cygnus.com>
* 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 <kespenla@student.informatik.uni-ulm.de>
* 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 <rth@cygnus.com>
Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
* 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.

View File

@ -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;

View File

@ -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;
}