This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

static object constructor bug.


Hi, heres a really obscure bug to do with static object constructors.
I am using an sgi-irix5.3 system.  This bug appears in gcc-2.7.2.1
and egcs-971114.

I assume that this will occur for other systems.  I don't really have
one to try it on.

class B {
public:
	B() {}
	~B() {}
};

class A {
public:
	A();
	~A();
protected:
	static B b;
};

B A::b;
A::A() {
}

A::~A() {
}

nm -B t.o | grep GLOB
000000b8 T _GLOBAL_$D$_1A$b
00000001 D _GLOBAL_$F$_1A$b
0000011c T _GLOBAL_$I$_1A$b

when B A::b; moved after A::A()

nm -B t.o | grep GLOB
000000b8 T _GLOBAL_$D$__1A
00000001 D _GLOBAL_$F$__1A
0000011c T _GLOBAL_$I$__1A


Cheers,
Paul Kendall
Product Development Manager
Orion Systems New Zealand Ltd



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]