diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1997-09-03 14:41:11 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1997-09-03 14:41:11 -0400 |
commit | 03e707055891d5eaaf5dc9e850123bd2dd16ba38 (patch) | |
tree | 004ddc4a3ac77fc22b4096bda212e1211a1a2827 /gcc | |
parent | 57163df067f5bc899c643fc2c05c776ed8fddee1 (diff) | |
download | gcc-03e707055891d5eaaf5dc9e850123bd2dd16ba38.zip gcc-03e707055891d5eaaf5dc9e850123bd2dd16ba38.tar.gz gcc-03e707055891d5eaaf5dc9e850123bd2dd16ba38.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 35 |
3 files changed, 48 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b814f98..fe2bdba 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 <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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index f2fe038..b30f78f 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 4c79d94..9ba46ac 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; } |