re PR c++/5571 (crash in initialization of a static variable)
authorMark Mitchell <mark@codesourcery.com>
Sun, 7 Apr 2002 06:09:27 +0000 (06:09 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 7 Apr 2002 06:09:27 +0000 (06:09 +0000)
commit0154eaa8122a7a848fd40a79d30d3835508e2ab6
treeee0530774216b52056190f27b4f1d7190346ac3d
parentda00eaab0b9831c4d6aa278547c75cbad1ce6595
re PR c++/5571 (crash in initialization of a static variable)

PR c++/5571
* stor-layout.c (layout_decl): Reset the RTL for the decl.

* class.c (layout_class_type): Remember incomplete static
variables.
(finish_struct_1): Call complete_vars, not
hack_incomplete_structures.
* cp-tree.h (hack_incomplete_structures): Rename to ...
(complete_vars): ... this.
(struct saved_scope): Remove incomplete.
(namespace_scope_incomplete): Remove.
* decl.c (struct binding_level): Remove incomplete.
(incomplete_vars): New variable.
(mark_binding_level): Don't mark incomplete.
(print_binding_level): Don't print it.
(mark_saved_scope): Don't mark incomplete.
(pushdecl): Use maybe_register_incopmlete_var.
(cxx_init_decl_processing): Register incomplete_vars for GC.
(start_decl_1): Clarify error message.
(hack_incomplete_vars): Remove.
(maybe_register_incomplete_var): New function.
(complete_vars): Likewise.

* g++.dg/opt/static2.C: New test.

From-SVN: r51978
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/static2.C [new file with mode: 0644]