* decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
needs destruction.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195062
138bc75d-0d04-0410-961f-
82ee72b054a4
+2013-01-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/55893
+ * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
+ needs destruction.
+
2013-01-09 Jakub Jelinek <jakub@redhat.com>
PR c/48418
}
else if (was_readonly)
TREE_READONLY (decl) = 1;
+
+ /* Likewise if it needs destruction. */
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ TREE_READONLY (decl) = 0;
}
make_rtl_for_nonlocal_decl (decl, init, asmspec);
--- /dev/null
+// PR c++/55893
+// { dg-final { scan-assembler-not "rodata" } }
+
+struct foo
+{
+ virtual ~foo ();
+};
+
+int main ()
+{
+ static const foo tmp;
+}