diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-05-22 19:22:24 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-05-22 19:22:24 +0000 |
commit | 1bd229b76d79228d76f15fb7c450e5462503d133 (patch) | |
tree | 131788ce5f4f5bc288ec6bbf9206b4bbba264b05 /gcc | |
parent | 6a70560c4c363f6d7d9a927a146d77753b2f041b (diff) | |
download | gcc-1bd229b76d79228d76f15fb7c450e5462503d133.zip gcc-1bd229b76d79228d76f15fb7c450e5462503d133.tar.gz gcc-1bd229b76d79228d76f15fb7c450e5462503d133.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/assign1.C | 7 |
4 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 28ee033..4cfa827 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + 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 <mark@codesourcery.com> diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 93d6c22..5ee2ba1 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 79ec93c..8b284e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/27716 + * g++.dg/other/assign1.C: New test. + 2006-05-22 Kazu Hirata <kazu@codesourcery.com> 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 0000000..1983680 --- /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" } +} |