(C++) tidying patch

Jason Merrill jason@redhat.com
Mon Jul 17 14:28:00 GMT 2000


This patch fixes two --enable-checking crashes, an error compiling
libgcc with strict prototypes, and an ungrammatical error message.

2000-07-17  Jason Merrill  <jason@redhat.com>

        * typeck.c (build_binary_op): Fix grammar in warning.

        * exception.cc (__eh_free): Fix prototype.

        * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR.

        * decl.c (pushdecl): Handle seeing an OVERLOAD in
        IDENTIFIER_NAMESPACE_VALUE.

Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.376
diff -c -p -r1.376 decl2.c
*** decl2.c	2000/07/10 06:32:58	1.376
--- decl2.c	2000/07/17 21:26:32
*************** finish_decl_parsing (decl)
*** 4310,4315 ****
--- 4310,4317 ----
        /* For attribute handling.  */
        TREE_VALUE (decl) = finish_decl_parsing (TREE_VALUE (decl));
        return decl;
+     case TEMPLATE_ID_EXPR:
+       return decl;
      default:
        my_friendly_abort (5);
        return NULL_TREE;
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.655
diff -c -p -r1.655 decl.c
*** decl.c	2000/07/10 10:56:22	1.655
--- decl.c	2000/07/17 21:26:39
*************** pushdecl (x)
*** 4019,4033 ****
  	{
  	  tree decl;
  
! 	  if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
! 	      && IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
! 	      && (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
! 		  || TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
! 	    decl = IDENTIFIER_NAMESPACE_VALUE (name);
! 	  else
! 	    decl = NULL_TREE;
  
! 	  if (decl
  	      /* If different sort of thing, we already gave an error.  */
  	      && TREE_CODE (decl) == TREE_CODE (x)
  	      && !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
--- 4019,4030 ----
  	{
  	  tree decl;
  
! 	  decl = IDENTIFIER_NAMESPACE_VALUE (name);
! 	  if (decl && TREE_CODE (decl) == OVERLOAD)
! 	    decl = OVL_FUNCTION (decl);
  
! 	  if (decl && decl != error_mark_node
! 	      && (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl))
  	      /* If different sort of thing, we already gave an error.  */
  	      && TREE_CODE (decl) == TREE_CODE (x)
  	      && !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
Index: exception.cc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/exception.cc,v
retrieving revision 1.35
diff -c -p -r1.35 exception.cc
*** exception.cc	2000/06/06 16:38:49	1.35
--- exception.cc	2000/07/17 21:26:40
*************** extern "C" cp_eh_info **__get_eh_info ()
*** 120,126 ****
  
  /* Exception allocate and free, defined in libgcc2. */
  extern "C" void *__eh_alloc(size_t);
! extern "C" void __eh_free();
  
  /* Is P the type_info node for a pointer of some kind?  */
  
--- 120,126 ----
  
  /* Exception allocate and free, defined in libgcc2. */
  extern "C" void *__eh_alloc(size_t);
! extern "C" void __eh_free(void *);
  
  /* Is P the type_info node for a pointer of some kind?  */
  
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.297
diff -c -p -r1.297 typeck.c
*** typeck.c	2000/07/10 07:16:23	1.297
--- typeck.c	2000/07/17 21:26:43
*************** build_binary_op (code, orig_op0, orig_op
*** 3963,3969 ****
  						signed_type (result_type)))))
  	    /* OK */;
  	  else
! 	    warning ("comparison between a signed and an unsigned integer expressions");
  
  	  /* Warn if two unsigned values are being compared in a size
  	     larger than their original size, and one (and only one) is the
--- 3963,3969 ----
  						signed_type (result_type)))))
  	    /* OK */;
  	  else
! 	    warning ("comparison between signed and unsigned integer expressions");
  
  	  /* Warn if two unsigned values are being compared in a size
  	     larger than their original size, and one (and only one) is the


More information about the Gcc-patches mailing list