From 36653a30cf11c5c1b1f10ce79237a33ce090e797 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Tue, 7 Feb 2006 11:11:30 +0000 Subject: [PATCH] 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) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110693 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 14 +++ gcc/cp/pt.c | 111 ++++++++++++++------- gcc/testsuite/ChangeLog | 17 ++++ gcc/testsuite/g++.dg/template/ttp15.C | 21 ++++ gcc/testsuite/g++.dg/template/ttp16.C | 7 ++ gcc/testsuite/g++.dg/template/ttp17.C | 7 ++ gcc/testsuite/g++.old-deja/g++.pt/ttp19.C | 25 ----- gcc/testsuite/g++.old-deja/g++.pt/ttp26.C | 34 ------- gcc/testsuite/g++.old-deja/g++.pt/ttp35.C | 36 ------- gcc/testsuite/g++.old-deja/g++.pt/ttp36.C | 30 ------ gcc/testsuite/g++.old-deja/g++.pt/ttp37.C | 30 ------ gcc/testsuite/g++.old-deja/g++.pt/ttp38.C | 30 ------ gcc/testsuite/g++.old-deja/g++.pt/ttp39.C | 30 ------ gcc/testsuite/g++.old-deja/g++.pt/ttp40.C | 21 ---- gcc/testsuite/g++.old-deja/g++.pt/ttp51.C | 14 --- gcc/testsuite/g++.old-deja/g++.pt/ttp9.C | 14 --- libstdc++-v3/ChangeLog | 6 ++ libstdc++-v3/testsuite/testsuite_tr1.h | 14 +++ .../type_properties/extent/extent.cc | 16 +-- 19 files changed, 167 insertions(+), 310 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/ttp15.C create mode 100644 gcc/testsuite/g++.dg/template/ttp16.C create mode 100644 gcc/testsuite/g++.dg/template/ttp17.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp19.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp26.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp35.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp36.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp37.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp38.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp39.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp40.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp51.C delete mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp9.C 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