Commit d192828a by Geoffrey Keating

[multiple changes]

2003-06-10  Andrew Pinski  <pinskia@physics.uc.edu>

	* decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY.
	(start_cleanup_cnt): New.

2003-06-10  Geoffrey Keating  <geoffk@apple.com>

	* g++.dg/pch/static-1.C: New file.
	* g++.dg/pch/static-1.Hs: New file.

From-SVN: r67719
parent 4db8f48a
2003-06-10 Andrew Pinski <pinskia@physics.uc.edu>
* decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY.
(start_cleanup_cnt): New.
2003-06-10 Mark Mitchell <mark@codesourcery.com>
PR c++/11131
......
......@@ -8347,10 +8347,11 @@ get_dso_handle_node (void)
/* Begin a new function with internal linkage whose job will be simply
to destroy some particular variable. */
static GTY(()) int start_cleanup_cnt;
static tree
start_cleanup_fn (void)
{
static int counter = 0;
int old_interface_only = interface_only;
int old_interface_unknown = interface_unknown;
char name[32];
......@@ -8377,7 +8378,7 @@ start_cleanup_fn (void)
/* Build the function type itself. */
fntype = build_function_type (void_type_node, parmtypes);
/* Build the name of the function. */
sprintf (name, "__tcf_%d", counter++);
sprintf (name, "__tcf_%d", start_cleanup_cnt++);
/* Build the function declaration. */
fndecl = build_lang_decl (FUNCTION_DECL, get_identifier (name), fntype);
/* It's a function with internal linkage, generated by the
......
2003-06-10 Geoffrey Keating <geoffk@apple.com>
* g++.dg/pch/static-1.C: New file.
* g++.dg/pch/static-1.Hs: New file.
2003-06-10 Richard Henderson <rth@redhat.com>
* gcc.dg/asm-7.c: Adjust expected warning text.
......
#include "static-1.H"
int LocalStaticTest()
{
static A sa;
}
int main(int argc, char **argv)
{
A::StaticTest();
}
class A
{
public:
int val;
~A() {
int i = 2;
}
static void StaticTest() {
static A a;
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment