aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-07-06 13:59:34 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-07-06 13:59:34 -0700
commita29f2ec14aa11735d7b0c781c73534a14773ee31 (patch)
treebf8ef4c3bfe41b0b7d4738ee4cb97f549d0e70e4 /gcc
parent8ac1abdf6a3dc65db23657aa45e0c201eb1a268f (diff)
downloadgcc-a29f2ec14aa11735d7b0c781c73534a14773ee31.zip
gcc-a29f2ec14aa11735d7b0c781c73534a14773ee31.tar.gz
gcc-a29f2ec14aa11735d7b0c781c73534a14773ee31.tar.bz2
(build_conditional_expr): All simplified results
must go through pedantic_non_lvalue. From-SVN: r4865
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 33b20c65..31aa96d 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3590,7 +3590,7 @@ build_conditional_expr (ifexp, op1, op2)
&& TREE_CODE (TREE_TYPE (op1)) != FUNCTION_TYPE)
{
if (TREE_CODE (ifexp) == INTEGER_CST)
- return (integer_zerop (ifexp) ? op2 : op1);
+ return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
return fold (build (COND_EXPR, TREE_TYPE (op1), ifexp, op1, op2));
}
@@ -3715,7 +3715,7 @@ build_conditional_expr (ifexp, op1, op2)
{
result_type = TREE_TYPE (op1);
if (TREE_CONSTANT (ifexp))
- return (integer_zerop (ifexp) ? op2 : op1);
+ return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
if (TYPE_MODE (result_type) == BLKmode)
{
@@ -3748,7 +3748,7 @@ build_conditional_expr (ifexp, op1, op2)
#endif /* 0 */
if (TREE_CODE (ifexp) == INTEGER_CST)
- return integer_zerop (ifexp) ? op2 : op1;
+ return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
return fold (build (COND_EXPR, result_type, ifexp, op1, op2));
}