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

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

From-SVN: r113991

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

index 5c07ea6916b3bf7335ce904114c1a1503c97487b..7e1d11e19dbb10fa917acba311f2a68530692e1c 100644 (file)
@@ -1,3 +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.
+
 2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27582
index 1c60dc43d91bb6dfad955c9f404300cde2305fb3..a4811546163212a1d42dd4b6c25edfc99f220e10 100644 (file)
@@ -5275,7 +5275,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 fd9901b5e5f74be81bf4d467e4e4c5a54b1a40e0..3b28f118103e1f6e180ab8eb74f31b9f35cd5295 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27716
+       * g++.dg/other/assign1.C: New test.
+
        PR c++/27451
        * g++.dg/ext/asm9.C: New test.
 
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" }
+}