summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-23 02:33:25 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-23 02:33:25 +0000
commit29eda12ac8a5916acad35abfe6ebf961f8df45ec (patch)
treee0891ad5e5c581512ec7f328fe803532709174ae /gcc/c-typeck.c
parent0d3c50c819cebd228413dae7a443f94f6178bb4f (diff)
downloadppe42-gcc-29eda12ac8a5916acad35abfe6ebf961f8df45ec.tar.gz
ppe42-gcc-29eda12ac8a5916acad35abfe6ebf961f8df45ec.zip
* c-typeck.c (emit_side_effect_warnings): Ignore error marks.
(c_finish_stmt_expr): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 63c91210015..beef504d362 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -6651,7 +6651,9 @@ c_finish_for_stmt (tree body, tree for_stmt)
static void
emit_side_effect_warnings (tree expr)
{
- if (!TREE_SIDE_EFFECTS (expr))
+ if (expr == error_mark_node)
+ ;
+ else if (!TREE_SIDE_EFFECTS (expr))
{
if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
warning ("%Hstatement with no effect",
@@ -6766,7 +6768,9 @@ c_finish_stmt_expr (tree body)
/* In the case that the BIND_EXPR is not necessary, return the
expression out from inside it. */
- if (last == BIND_EXPR_BODY (body) && BIND_EXPR_VARS (body) == NULL)
+ if (last == error_mark_node
+ || (last == BIND_EXPR_BODY (body)
+ && BIND_EXPR_VARS (body) == NULL))
return last;
/* Extract the type of said expression. */
OpenPOWER on IntegriCloud