This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) patch to build_conditional_expr
- To: egcs-patches at cygnus dot com
- Subject: (C++) patch to build_conditional_expr
- From: Jason Merrill <jason at cygnus dot com>
- Date: Sat, 3 Oct 1998 15:56:13 -0700
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