This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/20172: Invalid non-type template parametersnot diagnosed
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Jun 2005 17:30:06 +0100
- Subject: Re: [patch] Fix PR c++/20172: Invalid non-type template parametersnot diagnosed
- References: <200506100955.j5A9tNDS017925@relay.rwth-aachen.de>
Volker Reichelt wrote:
2005-06-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/20172
* pt.c (tsubst_template_parms): Check for invalid non-type parameters.
===================================================================
--- gcc/gcc/cp/pt.c 2005-04-08 21:36:01.000000000 +0200
+++ gcc/gcc/cp/pt.c 2005-06-09 01:13:03.000000000 +0200
@@ -5962,6 +5962,9 @@ tsubst_template_parms (tree parms, tree
tree parm_decl = TREE_VALUE (tuple);
parm_decl = tsubst (parm_decl, args, complain, NULL_TREE);
+ if (TREE_CODE (parm_decl) != TEMPLATE_DECL)
+ invalid_nontype_parm_type_p (TREE_TYPE (parm_decl), complain);
+
default_value = tsubst_template_arg (default_value, args,
complain, NULL_TREE);
why ignore the return value from invalid_nontype_parm_type_p? How are type parms
not checked here (aren't they TYPE_DECL). I can look in more detail next week.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk