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 string member bug on hp



Lars Albertsson writes:
 > 
 > The following program causes core dump using egcs-1.0.2 on
 > hppa1.1-hp-hpux9.05:
 > 
 > #include <iostream>
 > #include <string>
 > 
 > class foo {
 > public:
 >   foo() {};
 > 
 >   string bar() const { return bar_; };
 > 
 > private:
 >   static string bar_;
 > };
 > 
 > string foo::bar_("foobar");
 > 
 > int 
 > main(int, char **)
 > {
 >   foo f;
 > 
 >   cout << f.bar() << endl;
 > 
 >   return 0;
 > 
 > }
 > 
 > 
 > When debugging, gdb seems slightly confused, but either claims
 > foo::bar_ is optimised out or improperly initialised.
 > 
 > The program is compiled with -gstabs.
 > 

Works OK on  hppa1.1-hp-hpux10.20   
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

~>g++ -o foo foo.C
~>g++ -v
Reading specs from /home/buyuk/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
~>./foo
foobar

Osman


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