aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-04-12 12:44:47 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-04-12 12:44:47 -0700
commit29df70e6ff84935cebf6aa0e568d1fbf8234fb31 (patch)
tree9159a550cc7e21a881e3bb6e647bca9e2a95b28a /gcc
parentfa5679bb7f9bfd4a47059a9fa62f304aef606eaf (diff)
downloadgcc-29df70e6ff84935cebf6aa0e568d1fbf8234fb31.zip
gcc-29df70e6ff84935cebf6aa0e568d1fbf8234fb31.tar.gz
gcc-29df70e6ff84935cebf6aa0e568d1fbf8234fb31.tar.bz2
(internal_build_compound_expr): When pedantic...
(internal_build_compound_expr): When pedantic, don't simplify a COMPOUND_EXPR, so that it won't be mistaken for an lvalue or an integer constant expression. From-SVN: r4102
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index e6d46ed..d7745e3 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3788,7 +3788,9 @@ internal_build_compound_expr (list, first_p)
rest = internal_build_compound_expr (TREE_CHAIN (list), FALSE);
- if (! TREE_SIDE_EFFECTS (TREE_VALUE (list)))
+ /* When pedantic, a compound expression can be neither an lvalue
+ nor an integer constant expression. */
+ if (! TREE_SIDE_EFFECTS (TREE_VALUE (list)) && ! pedantic)
return rest;
return build (COMPOUND_EXPR, TREE_TYPE (rest), TREE_VALUE (list), rest);