re PR c++/27716 (ICE with invalid assignment)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 22 May 2006 19:22:24 +0000 (19:22 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 22 May 2006 19:22:24 +0000 (19:22 +0000)
PR c++/27716
* typeck.c (build_modify_expr): Test arguments for error_operand_p.

* g++.dg/other/assign1.C: New test.

From-SVN: r113990

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/assign1.C [new file with mode: 0644]

index 28ee03321accf483fdfabb0e3349f4fe4855a16e..4cfa8277d676adededbc947cd385a025bab59578 100644 (file)
@@ -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>
index 93d6c22698fdd1f6e2f65c5c221fe6ceccbf4d0c..5ee2ba19373f0ad45ea67bb5f16f2334edd3e820 100644 (file)
@@ -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".  */
index 79ec93c6995edb7a77b6aba64b9cb87252888d58..8b284e8313b7a48dca7d1eca4f0910c6f123510e 100644 (file)
@@ -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 (file)
index 0000000..1983680
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/27716
+// { dg-do compile }
+
+int foo()
+{
+  return i ""= i;  // { dg-error "not declared|string constant" }
+}