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]

Re: [C++ PATCH] Fix bug 1509


Jason Merrill wrote:
> 
> Please use a more informative name for the new function; perhaps
> 
>   invalid_nontype_parm_type_p
Done, sorry.

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-01-15  Nathan Sidwell  <nathan@codesourcery.com>

	* pt.c (check_nontype_parm): Rename to ...
	(invalid_nontype_parm_type_p): ... here.
	(process_template_parm): Adjust.
	(convert_template_argument): Adjust.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
retrieving revision 1.504
diff -c -3 -p -r1.504 pt.c
*** pt.c	2001/01/15 09:30:02	1.504
--- pt.c	2001/01/15 16:17:32
*************** static tree for_each_template_parm_r PAR
*** 169,175 ****
  static tree instantiate_clone PARAMS ((tree, tree));
  static tree copy_default_args_to_explicit_spec_1 PARAMS ((tree, tree));
  static void copy_default_args_to_explicit_spec PARAMS ((tree));
! static int check_nontype_parm PARAMS ((tree, int));
  
  /* Called once to initialize pt.c.  */
  
--- 169,175 ----
  static tree instantiate_clone PARAMS ((tree, tree));
  static tree copy_default_args_to_explicit_spec_1 PARAMS ((tree, tree));
  static void copy_default_args_to_explicit_spec PARAMS ((tree));
! static int invalid_nontype_parm_type_p PARAMS ((tree, int));
  
  /* Called once to initialize pt.c.  */
  
*************** process_template_parm (list, next)
*** 1934,1940 ****
  
        /* A template parameter is not modifiable.  */
        TREE_READONLY (parm) = 1;
!       if (check_nontype_parm (TREE_TYPE (parm), 1))
          TREE_TYPE (parm) = void_type_node;
        decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm));
        DECL_INITIAL (parm) = DECL_INITIAL (decl) 
--- 1934,1940 ----
  
        /* A template parameter is not modifiable.  */
        TREE_READONLY (parm) = 1;
!       if (invalid_nontype_parm_type_p (TREE_TYPE (parm), 1))
          TREE_TYPE (parm) = void_type_node;
        decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm));
        DECL_INITIAL (parm) = DECL_INITIAL (decl) 
*************** convert_template_argument (parm, arg, ar
*** 3417,3423 ****
      {
        tree t = tsubst (TREE_TYPE (parm), args, complain, in_decl);
  
!       if (check_nontype_parm (t, complain))
          return error_mark_node;
        
        if (processing_template_decl)
--- 3417,3423 ----
      {
        tree t = tsubst (TREE_TYPE (parm), args, complain, in_decl);
  
!       if (invalid_nontype_parm_type_p (t, complain))
          return error_mark_node;
        
        if (processing_template_decl)
*************** current_instantiation ()
*** 10307,10313 ****
     non-zero, then complain. */
  
  static int
! check_nontype_parm (type, complain)
       tree type;
       int complain;
  {
--- 10307,10313 ----
     non-zero, then complain. */
  
  static int
! invalid_nontype_parm_type_p (type, complain)
       tree type;
       int complain;
  {

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