+2004-08-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14428
+ * pt.c (redeclare_class_template): Check the type of non-type and
+ template template parameter.
+
2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
tree tmpl_default = TREE_PURPOSE (TREE_VEC_ELT (tmpl_parms, i));
tree parm_default = TREE_PURPOSE (TREE_VEC_ELT (parms, i));
- if (TREE_CODE (tmpl_parm) != TREE_CODE (parm))
+ /* TMPL_PARM and PARM can be either TYPE_DECL, PARM_DECL, or
+ TEMPLATE_DECL. */
+ if (TREE_CODE (tmpl_parm) != TREE_CODE (parm)
+ || (TREE_CODE (tmpl_parm) != TYPE_DECL
+ && !same_type_p (TREE_TYPE (tmpl_parm), TREE_TYPE (parm))))
{
cp_error_at ("template parameter `%#D'", tmpl_parm);
error ("redeclared here as `%#D'", parm);
+2004-08-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14428
+ * g++.dg/template/redecl2.C: New test.
+
2004-08-24 Bud Davis <bdavis9659@comcast.net>
PR fortran/17143
--- /dev/null
+// { dg-do compile }
+
+// Origin: heinlein@informatik.uni-ulm.de
+
+// PR c++/14428: Redeclaration of class template with wrong
+// non-type template parameter.
+
+template <int i> struct X; // { dg-error "template parameter" }
+template <int* p> struct X; // { dg-error "redeclared here" }