typeck.c (build_conditional_expr): Only fold if ifexp is an INTEGER_CST.
authorJason Merrill <jason@yorick.cygnus.com>
Sat, 3 Oct 1998 15:56:25 +0000 (15:56 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 3 Oct 1998 15:56:25 +0000 (11:56 -0400)
* typeck.c (build_conditional_expr): Only fold if ifexp is an
INTEGER_CST.

From-SVN: r22794

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 23ae36950158a8c4006ba1ca355a047b8f8ba860..1c26ef639a02972f0fc48953610e475ccb2fb4d0 100644 (file)
@@ -1,5 +1,8 @@
 1998-10-03  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * typeck.c (build_conditional_expr): Only fold if ifexp is an
+       INTEGER_CST.
+
        * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
        instead of linkage.
 
index a3c75d9433739a7cfad99aea0f5255ff9e8769e2..40b5b7e76fbaae6a552a26590640cdbe6b676316 100644 (file)
@@ -5345,7 +5345,7 @@ build_conditional_expr (ifexp, op1, op2)
     op2 = convert_for_initialization
       (NULL_TREE, result_type, op2, LOOKUP_NORMAL, "converting", NULL_TREE, 0);
 
-  if (TREE_CONSTANT (ifexp))
+  if (TREE_CODE (ifexp) == INTEGER_CST)
     return integer_zerop (ifexp) ? op2 : op1;
 
   return convert_from_reference