From: Mark Mitchell Date: Tue, 7 Feb 2006 11:11:30 +0000 (+0000) Subject: re PR c++/9737 ([DR150] Partial template specialisation selection failure involving... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7e9396544525de5ad6e09527b4b3d29ab1e6429;p=gcc.git re PR c++/9737 ([DR150] Partial template specialisation selection failure involving template parameter defaults) PR c++/9737 * pt.c (coerce_template_template_parms): Do not templates with excess default arguments to match template template parameters with fewer parameters. (coerce_template_parms): Add use_default_args parameter; use default arguments only when true. (lookup_template_class): Adjust call to coerce_template_parms. (fn_type_unification): Likewise. (unify): Likewise. (get_bindings): Likewise. (dependent_type_p): Add assertions. PR c++/9737 * g++.dg/template/ttp15.C: New test. * g++.dg/template/ttp16.C: Likewise. * g++.dg/template/ttp17.C: Likewise. * g++.old-deja/g++.pt/ttp36.C: Remove. * g++.old-deja/g++.pt/ttp19.C: Likewise. * g++.old-deja/g++.pt/ttp37.C: Likewise. * g++.old-deja/g++.pt/ttp38.C: Likewise. * g++.old-deja/g++.pt/ttp39.C: Likewise. * g++.old-deja/g++.pt/ttp9.C: Likewise. * g++.old-deja/g++.pt/ttp40.C: Likewise. * g++.old-deja/g++.pt/ttp51.C: Likewise. * g++.old-deja/g++.pt/ttp26.C: Likewise. * g++.old-deja/g++.pt/ttp36.C: Likewise. * testsuite/testsuite_tr1.h (test_property): New function. * testsuite/tr1/4_metaprogramming/type_properties/extent/extent.cc (test01) From-SVN: r110693 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 18da1285724..cdfeaf33d1e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2006-02-07 Mark Mitchell + + PR c++/9737 + * pt.c (coerce_template_template_parms): Do not templates with + excess default arguments to match template template parameters + with fewer parameters. + (coerce_template_parms): Add use_default_args parameter; use + default arguments only when true. + (lookup_template_class): Adjust call to coerce_template_parms. + (fn_type_unification): Likewise. + (unify): Likewise. + (get_bindings): Likewise. + (dependent_type_p): Add assertions. + 2006-02-06 Roger Sayle * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index aac7f3ca22a..b1da4af144c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -102,7 +102,8 @@ static tree classtype_mangled_name (tree); static char* mangle_class_name_for_template (const char *, tree, tree); static tree tsubst_initializer_list (tree, tree); static tree get_class_bindings (tree, tree, tree); -static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, int); +static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, + bool, bool); static void tsubst_enum (tree, tree, tree); static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); @@ -3718,17 +3719,12 @@ convert_nontype_argument (tree type, tree expr) 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