This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/20172: Invalid non-type template parametersnot diagnosed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]