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]

[C++] PATCH to make convert_to_void respect TREE_NO_UNUSED_WARNING


The patches to build_modify_expr and get_unwidened for 13371 resulted in a
spurious warning on g++.old-deja/g++.mike/p4173.C.  This turned out to be
because convert_to_void does not respect TREE_NO_UNUSED_WARNING, which is
intended specifically to suppress such a warning.

Fixed thus, tested x86_64-pc-linux-gnu, applied to trunk.

2003-12-19  Jason Merrill  <jason@redhat.com>

	* cvt.c (convert_to_void): Don't warn about the RHS of a comma
	being useless if TREE_NO_UNUSED_WARNING is set.

*** cvt.c.~1~	2003-12-19 17:33:34.000000000 -0500
--- cvt.c	2003-12-19 16:02:14.000000000 -0500
*************** convert_to_void (tree expr, const char *
*** 817,823 ****
          /* The second part of a compound expr contains the value.  */
          tree op1 = TREE_OPERAND (expr,1);
          tree new_op1 = convert_to_void
! 	  (op1, implicit ? "right-hand operand of comma" : NULL);
          
          if (new_op1 != op1)
  	  {
--- 817,824 ----
          /* The second part of a compound expr contains the value.  */
          tree op1 = TREE_OPERAND (expr,1);
          tree new_op1 = convert_to_void
! 	  (op1, (implicit && !TREE_NO_UNUSED_WARNING (expr)
! 		 ? "right-hand operand of comma" : NULL));
          
          if (new_op1 != op1)
  	  {

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