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 build_conditional_expr


Another case of a C frontend update not being propagated.  Fixes
g++.other/null2.C.  Checked in.

1998-10-03  Jason Merrill  <jason@yorick.cygnus.com>

	* typeck.c (build_conditional_expr): Only fold if ifexp is an
	INTEGER_CST.

Index: typeck.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck.c,v
retrieving revision 1.110
diff -c -p -r1.110 typeck.c
*** typeck.c	1998/09/25 09:00:03	1.110
--- typeck.c	1998/10/03 22:54:46
*************** build_conditional_expr (ifexp, op1, op2)
*** 5345,5351 ****
      op2 = convert_for_initialization
        (NULL_TREE, result_type, op2, LOOKUP_NORMAL, "converting", NULL_TREE, 0);
  
!   if (TREE_CONSTANT (ifexp))
      return integer_zerop (ifexp) ? op2 : op1;
  
    return convert_from_reference
--- 5345,5351 ----
      op2 = convert_for_initialization
        (NULL_TREE, result_type, op2, LOOKUP_NORMAL, "converting", NULL_TREE, 0);
  
!   if (TREE_CODE (ifexp) == INTEGER_CST)
      return integer_zerop (ifexp) ? op2 : op1;
  
    return convert_from_reference


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