This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
static string member bug on hp
- To: Lars Albertsson <lalle at sics dot se>
- Subject: static string member bug on hp
- From: U-E59264-Osman Buyukisik <buyuk at c0230 dot ae dot ge dot com>
- Date: Tue, 5 May 1998 15:01:10 -0400 (EDT)
- Cc: egcs-bugs at cygnus dot com
- References: <u6zemy8zo9j.fsf@saruman.sics.se>
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