/cp
2017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81061
* typeck.c (cp_build_modify_expr): Upon cxx_readonly_error
immediately return error_mark_node.
/testsuite
2017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81061
* g++.dg/other/const5.C: New.
From-SVN: r255613
+2017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/81061
+ * typeck.c (cp_build_modify_expr): Upon cxx_readonly_error
+ immediately return error_mark_node.
+
2017-12-13 Nathan Sidwell <nathan@acm.org>
PR c++/15272
{
if (complain & tf_error)
cxx_readonly_error (lhs, lv_assign);
- else
- return error_mark_node;
+ return error_mark_node;
}
/* If storing into a structure or union member, it may have been given a
+2017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/81061
+ * g++.dg/other/const5.C: New.
+
2017-12-13 Alexandre Oliva <aoliva@redhat.com>
Jakub Jelinek <jakub@redhat.com>
--- /dev/null
+// PR c++/81061
+
+const int i = 0;
+
+void foo()
+{
+ (0, i) = 1; // { dg-error "read-only" }
+}