* decl.c (cp_finish_decl): Also clear was_readonly if a static var
needs runtime initialization.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125229
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/31806
+ * decl.c (cp_finish_decl): Also clear was_readonly if a static var
+ needs runtime initialization.
+
2007-05-31 Paolo Carlini <pcarlini@suse.de>
PR c++/32158
/* If a TREE_READONLY variable needs initialization
at runtime, it is no longer readonly and we need to
avoid MEM_READONLY_P being set on RTL created for it. */
- if (init && TREE_READONLY (decl))
- TREE_READONLY (decl) = 0;
+ if (init)
+ {
+ if (TREE_READONLY (decl))
+ TREE_READONLY (decl) = 0;
+ was_readonly = 0;
+ }
expand_static_init (decl, init);
}
}