diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-09-06 09:34:00 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-09-06 09:34:00 +0000 |
commit | d7c4edd08e0a1e8a519affb51d40bcffbd60ff73 (patch) | |
tree | c3755bc86140b1a61e02f7d38962107ce64f2907 /gcc | |
parent | 2ff0c96233b86edf05a09cd8f59ceee0c3a3bf7a (diff) | |
download | gcc-d7c4edd08e0a1e8a519affb51d40bcffbd60ff73.zip gcc-d7c4edd08e0a1e8a519affb51d40bcffbd60ff73.tar.gz gcc-d7c4edd08e0a1e8a519affb51d40bcffbd60ff73.tar.bz2 |
pt.c (type_unification_real): Replace switch with if.
* pt.c (type_unification_real): Replace switch with if.
(unify): Tsubst non-type parms before comparing.
From-SVN: r36195
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 15 |
2 files changed, 11 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ecd845b..7d49a32 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2000-09-06 Nathan Sidwell <nathan@codesourcery.com> + * pt.c (type_unification_real): Replace switch with if. + (unify): Tsubst non-type parms before comparing. + +2000-09-06 Nathan Sidwell <nathan@codesourcery.com> + * error.c (dump_typename): New function, broken out of ... (dump_type): ... here. Use it. * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b50f79f..51421fd 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7830,13 +7830,8 @@ type_unification_real (tparms, targs, parms, args, subr, if (!subr) maybe_adjust_types_for_deduction (strict, &parm, &arg); - switch (unify (tparms, targs, parm, arg, sub_strict)) - { - case 0: - break; - case 1: - return 1; - } + if (unify (tparms, targs, parm, arg, sub_strict)) + return 1; } /* Fail if we've reached the end of the parm list, and more args are present, and the parm list isn't variadic. */ @@ -8450,8 +8445,10 @@ unify (tparms, targs, parm, arg, strict) parameter-list and, if the corresponding template-argument is deduced, the template-argument type shall match the type of the template-parameter exactly, except that a template-argument - deduced from an array bound may be of any integral type. */ - if (same_type_p (TREE_TYPE (arg), TREE_TYPE (parm))) + deduced from an array bound may be of any integral type. + The non-type parameter might use already deduced type parameters. */ + if (same_type_p (TREE_TYPE (arg), + tsubst (TREE_TYPE (parm), targs, 0, NULL_TREE))) /* OK */; else if ((strict & UNIFY_ALLOW_INTEGER) && (TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE |