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]

[C++] PATCH to diagnostic subroutine sequence calls



The following finishes to compress consecutive calls to diagnostic
subroutines. 

OK?

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

2000-03-11  Gabriel Dos Reis  <gdr@codesourcery.com>

	* lex.c (whitespace_cr): Compress consecutive calls to warning().
	(do_identifier): Ditto for error().

	* pt.c (convert_nontype_argument): Ditto for cp_error().
	(convert_template_argument): Ditto for cp_pedwarn().

Index: lex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/lex.c,v
retrieving revision 1.184
diff -p -r1.184 lex.c
*** lex.c	2000/03/08 09:07:36	1.184
--- lex.c	2000/03/12 12:56:46
*************** whitespace_cr (c)
*** 2183,2190 ****
  	 are undefined.  */
        if (pedantic && !newline_warning)
  	{
! 	  warning ("carriage return in source file");
! 	  warning ("(we only warn about the first carriage return)");
  	  newline_warning = 1;
  	}
        return 1;
--- 2183,2189 ----
  	 are undefined.  */
        if (pedantic && !newline_warning)
  	{
! 	  warning ("carriage return in source file (we only warn about the first carriage return)");
  	  newline_warning = 1;
  	}
        return 1;
*************** do_identifier (token, parsing, args)
*** 3495,3502 ****
  
  	      if (! undeclared_variable_notice)
  		{
! 		  error ("(Each undeclared identifier is reported only once");
! 		  error ("for each function it appears in.)");
  		  undeclared_variable_notice = 1;
  		}
  	    }
--- 3494,3500 ----
  
  	      if (! undeclared_variable_notice)
  		{
! 		  error ("(Each undeclared identifier is reported only once for each function it appears in.)");
  		  undeclared_variable_notice = 1;
  		}
  	    }
Index: pt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
retrieving revision 1.404
diff -p -r1.404 pt.c
*** pt.c	2000/03/11 00:23:18	1.404
--- pt.c	2000/03/12 12:56:46
*************** convert_nontype_argument (type, expr)
*** 2742,2750 ****
  
        if (TREE_CODE (referent) == STRING_CST)
  	{
! 	  cp_error ("string literal %E is not a valid template argument", 
  		    referent);
- 	  error ("because it is the address of an object with static linkage");
  	  return NULL_TREE;
  	}
  
--- 2742,2749 ----
  
        if (TREE_CODE (referent) == STRING_CST)
  	{
! 	  cp_error ("string literal %E is not a valid template argument because it is the address of an object with static linkage", 
  		    referent);
  	  return NULL_TREE;
  	}
  
*************** convert_template_argument (parm, arg, ar
*** 3160,3167 ****
    if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
        && TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
      {
!       cp_pedwarn ("to refer to a type member of a template parameter,");
!       cp_pedwarn ("  use `typename %E'", arg);
        
        arg = make_typename_type (TREE_OPERAND (arg, 0),
  				TREE_OPERAND (arg, 1),
--- 3159,3165 ----
    if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
        && TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
      {
!       cp_pedwarn ("to refer to a type member of a template parameter, use `typename %E'", arg);
        
        arg = make_typename_type (TREE_OPERAND (arg, 0),
  				TREE_OPERAND (arg, 1),
*************** push_tinst_level (d)
*** 4300,4309 ****
  	return 0;
  
        last_template_error_tick = tinst_level_tick;
!       error ("template instantiation depth exceeds maximum of %d",
! 	     max_tinst_depth);
!       error (" (use -ftemplate-depth-NN to increase the maximum)");
!       cp_error ("  instantiating `%D'", d);
  
        print_template_context (0);
  
--- 4298,4305 ----
  	return 0;
  
        last_template_error_tick = tinst_level_tick;
!       cp_error ("template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN to increase the maximum) instantiating `%D'",
! 	     max_tinst_depth, d);
  
        print_template_context (0);
  


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