1.0.3b bug report
Pawel Salek
pawsa@ifm.liu.se
Tue Mar 23 14:54:00 GMT 1999
Hi,
I use
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
The following program (the command line: g++ buggy.cc):
class X {
public:
int f(void);
void b();
};
typedef struct {
int (X::*cmdH)(void);
} CmdDesc;
int X::f()
{ return 0; }
void X::b() {
CmdDesc a = {&f};
a.cmdH();
}
causes a "controled" crash of the g++ compiler:
buggy.cc: In method `void X::b()':
buggy.cc:15: Internal compiler error.
buggy.cc:15: Please submit a full bug report to `egcs-bugs@cygnus.com'.
When X::b() is replaced by the correct construction:
void X::b() {
CmdDesc a = {&f};
(this->*a.cmdH)();
}
the compilation doesn't crash.
Pawel
-----
Pawel Salek (pawsa@ifm.liu.se) WWW: http://www.ifm.liu.se/~pawsa/
Computational Physics Div., Linkoping, Sweden phone +46 13 281268
More information about the Gcc-bugs
mailing list