(C++) patch to parm list handling

Jason Merrill jason@cygnus.com
Mon Jun 28 00:09:00 GMT 1999


comp_target_parms passes in a TREE_LIST to dump_type, so we need to handle
it, or we get a sorry.  And we don't want to complain if we get a bad
conversion because of our silent rewriting of correct code...

Checked into main branch.

1999-06-25  Jason Merrill  <jason@yorick.cygnus.com>

	* error.c (dump_type_real): Handle TREE_LIST again.

	* typeck.c (comp_target_parms): Don't complain about 
	converting from () to (...) if !flag_strict_prototype.

Index: error.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/error.c,v
retrieving revision 1.77
diff -c -p -r1.77 error.c
*** error.c	1999/06/19 11:11:43	1.77
--- error.c	1999/06/26 07:22:44
*************** dump_type_real (t, v, canonical_name)
*** 211,216 ****
--- 211,221 ----
        OB_PUTS ("{unknown type}");
        break;
  
+     case TREE_LIST:
+       /* A list of function parms.  */
+       dump_parameters (t, 0, canonical_name);
+       break;
+ 
      case IDENTIFIER_NODE:
        OB_PUTID (t);
        break;
Index: typeck.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck.c,v
retrieving revision 1.169
diff -c -p -r1.169 typeck.c
*** typeck.c	1999/05/25 11:55:58	1.169
--- typeck.c	1999/06/26 07:22:44
*************** comp_target_parms (parms1, parms2, stric
*** 1357,1364 ****
  
    if (t1 == 0 && t2 != 0)
      {
!       cp_pedwarn ("ANSI C++ prohibits conversion from `(%#T)' to `(...)'",
! 		  parms2);
        return self_promoting_args_p (t2);
      }
    if (t2 == 0)
--- 1357,1369 ----
  
    if (t1 == 0 && t2 != 0)
      {
!       if (! flag_strict_prototype && t2 == void_list_node)
! 	/* t1 might be the arglist of a function pointer in extern "C"
! 	   declared to take (), which we fudged to (...).  Don't make the
! 	   user pay for our mistake.  */;
!       else
! 	cp_pedwarn ("ANSI C++ prohibits conversion from `%#T' to `(...)'",
! 		    parms2);
        return self_promoting_args_p (t2);
      }
    if (t2 == 0)


More information about the Gcc-patches mailing list