From: Kriang Lerdsuwanakij Date: Sun, 12 Jul 1998 03:06:46 +0000 (-0400) Subject: typeck.c (comptypes, [...]): Add parameter comparison. X-Git-Tag: prereleases/egcs-1.1-prerelease~310 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=744fac594b8f707fc4bbb7acbdcf4b8753d4cd71;p=gcc.git typeck.c (comptypes, [...]): Add parameter comparison. * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter comparison. * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a template template parameter, record its use. (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse its template arguments if exists. * pt.c (coerce_template_template_parms): New function equivalent to coerce_template_parms when IS_TMPL_PARM is true. (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter, all callers changed. (coerce_template_parms): Access ARGLIST properly when creating a new vector. Only accept implicit TYPE_DECL as valid argument for a template template parameter when it is a base class of current_class_type. Don't display error message when COMPLAIN is false. From-SVN: r21073 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d24b105b9aaa..19121c4b7905 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,6 +1,27 @@ +1998-07-12 Kriang Lerdsuwanakij + + * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter + comparison. + + * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a + template template parameter, record its use. + (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse + its template arguments if exists. + + * pt.c (coerce_template_template_parms): New function equivalent + to coerce_template_parms when IS_TMPL_PARM is true. + (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter, + all callers changed. + + (coerce_template_parms): Access ARGLIST properly when creating a + new vector. Only accept implicit TYPE_DECL as valid argument for + a template template parameter when it is a base class of + current_class_type. Don't display error message when COMPLAIN is + false. + 1998-07-12 Klaus Kaempf (kkaempf@progis.de) - * repo.c (get_base_filename): Use file_name_nondirectory (). + * repo.c (get_base_filename): Use file_name_nondirectory. (open_repo_file): Ditto. * cp-tree.h (file_name_nondirectory): Add prototype. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 23f52c2679d9..ebd67154c19c 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -298,7 +298,7 @@ dicat (lo, hi) OB_PUTC ('0' + ulo); } -__inline void +static __inline void flush_repeats (nrepeats, type) int nrepeats; tree type; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 42caf4654d6f..36d0c0d0c870 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -84,7 +84,7 @@ static char *mangle_class_name_for_template PROTO((char *, tree, tree, tree)); static tree tsubst_expr_values PROTO((tree, tree)); static int list_eq PROTO((tree, tree)); static tree get_class_bindings PROTO((tree, tree, tree, tree)); -static tree coerce_template_parms PROTO((tree, tree, tree, int, int, int)); +static tree coerce_template_parms PROTO((tree, tree, tree, int, int)); static tree tsubst_enum PROTO((tree, tree, tree *)); static tree add_to_template_args PROTO((tree, tree)); static void maybe_adjust_types_for_deduction PROTO((unification_kind_t, tree*, @@ -2347,6 +2347,82 @@ convert_nontype_argument (type, expr) return error_mark_node; } +/* Return 1 if PARM_PARMS and ARG_PARMS matches using rule for + template template parameters. Both PARM_PARMS and ARG_PARMS are + vectors of TREE_LIST nodes containing TYPE_DECL, TEMPLATE_DECL + or PARM_DECL. + + ARG_PARMS may contain more parameters than PARM_PARMS. If this is + the case, then extra parameters must have default arguments. + + Consider the example: + template class vector; + template