From e9f7dd36d5c2cc7a81fde78c3bc992ca153ee518 Mon Sep 17 00:00:00 2001 From: Kriang Lerdsuwanakij Date: Tue, 20 Jul 2004 16:02:13 +0000 Subject: [PATCH] re PR c++/16175 (Wrong type reported in diagnostic) PR c++/16175 * error.c (dump_type) : Output cv qualifier. * g++.dg/template/ttp10.C: New test. From-SVN: r84961 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/error.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/ttp10.C | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/ttp10.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2cf92d0a435..c05d91ffb72 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-20 Kriang Lerdsuwanakij + + PR c++/16175 + * error.c (dump_type) : Output + cv qualifier. + 2004-07-19 Mark Mitchell PR c++/16623 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 6fa99a7a801..cf1bf39f36b 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -316,6 +316,7 @@ dump_type (tree t, int flags) case BOUND_TEMPLATE_TEMPLATE_PARM: { tree args = TYPE_TI_ARGS (t); + pp_cxx_cv_qualifier_seq (cxx_pp, t); pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); pp_cxx_begin_template_argument_list (cxx_pp); dump_template_argument_list (args, flags); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a45e8575c34..64de9d5c8b0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-20 Kriang Lerdsuwanakij + + PR c++/16175 + * g++.dg/template/ttp10.C: New test. + 2004-07-20 Joseph S. Myers * gcc.dg/pr12625-1.c: New test. diff --git a/gcc/testsuite/g++.dg/template/ttp10.C b/gcc/testsuite/g++.dg/template/ttp10.C new file mode 100644 index 00000000000..09bdb1a8467 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp10.C @@ -0,0 +1,21 @@ +// { dg-do compile } + +// Origin: Ivan Godard +// Wolfgang Bangerth + +// PR c++/16175: Missing cv qualifier in error message output + +template struct Template {}; + +template class D> +struct B { + static void foo1(const D *); // { dg-error "const" } + static void foo2(volatile D *);// { dg-error "volatile" } +}; + +class E : protected B