PR c++/77375
* class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any TYPE_HAS_MUTABLE_P
for any bases.
* g++.dg/cpp0x/mutable1.C: New test.
From-SVN: r240195
+2016-09-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/77375
+ * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
+ TYPE_HAS_MUTABLE_P for any bases.
+
2016-09-16 Jason Merrill <jason@redhat.com>
* class.c (check_bases, set_one_vmethod_tm_attributes): Use
SET_CLASSTYPE_REF_FIELDS_NEED_INIT
(t, CLASSTYPE_REF_FIELDS_NEED_INIT (t)
| CLASSTYPE_REF_FIELDS_NEED_INIT (basetype));
+ if (TYPE_HAS_MUTABLE_P (basetype))
+ CLASSTYPE_HAS_MUTABLE (t) = 1;
/* A standard-layout class is a class that:
...
+2016-09-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/77375
+ * g++.dg/cpp0x/mutable1.C: New test.
+
2016-09-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77612
--- /dev/null
+// PR c++/77375
+// { dg-do run { target c++11 } }
+
+struct Base { mutable int i; };
+struct Derived : Base {};
+const Derived foo{};
+
+int
+main ()
+{
+ foo.i = 42;
+}