From: Volker Reichelt Date: Mon, 22 May 2006 19:22:24 +0000 (+0000) Subject: re PR c++/27716 (ICE with invalid assignment) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1bd229b76d79228d76f15fb7c450e5462503d133;p=gcc.git re PR c++/27716 (ICE with invalid assignment) PR c++/27716 * typeck.c (build_modify_expr): Test arguments for error_operand_p. * g++.dg/other/assign1.C: New test. From-SVN: r113990 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 28ee03321ac..4cfa8277d67 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2006-05-22 Volker Reichelt + PR c++/27716 + * typeck.c (build_modify_expr): Test arguments for error_operand_p. + * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE. 2006-05-21 Mark Mitchell diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 93d6c22698f..5ee2ba19373 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5502,7 +5502,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) bool plain_assign = (modifycode == NOP_EXPR); /* Avoid duplicate error messages from operands that had errors. */ - if (lhs == error_mark_node || rhs == error_mark_node) + if (error_operand_p (lhs) || error_operand_p (rhs)) return error_mark_node; /* Handle control structure constructs used as "lvalues". */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 79ec93c6995..8b284e8313b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-22 Volker Reichelt + + PR c++/27716 + * g++.dg/other/assign1.C: New test. + 2006-05-22 Kazu Hirata PR target/27266 diff --git a/gcc/testsuite/g++.dg/other/assign1.C b/gcc/testsuite/g++.dg/other/assign1.C new file mode 100644 index 00000000000..1983680dd7b --- /dev/null +++ b/gcc/testsuite/g++.dg/other/assign1.C @@ -0,0 +1,7 @@ +// PR c++/27716 +// { dg-do compile } + +int foo() +{ + return i ""= i; // { dg-error "not declared|string constant" } +}