c++/3274: gcc-3.0 bug
Hao Li
hli@haoli.org
Tue Jun 19 17:26:00 GMT 2001
>Number: 3274
>Category: c++
>Synopsis: typedef bug
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Jun 19 17:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Hao Li
>Release: 3.0
>Organization:
Onetta
>Environment:
System: Linux lexus 2.4.4 #1 Fri May 18 18:13:11 PDT 2001 i686 unknown
Architecture: i686
host: i686-redhat-linux-gnu
build: i686-redhat-linux-gnu
target: i686-redhat-linux-gnu
configured with: ../configure --prefix=/opt/gcc-3.0 --enable-shared --enable-threads --disable-nls i686-redhat-linux
>Description:
g++ 3.0 dies with "Internal error: Segmentation fault" when compiling
following code:
class test
{
public:
typedef bool (test::*ResponseFunc)(char*);
typedef bool RF(char*);
struct Command {
ResponseFunc respFunc;
};
RF setLosSwd;
RF getLosSwd;
RF printHelp;
static Command d_cmdTable[];
};
test::Command test::d_cmdTable[] = {
{&test::setLosSwd},
{&test::getLosSwd},
{&test::printHelp}
};
>How-To-Repeat:
Preprocessor output is the same as above.
>Fix:
If I don't use typedef of RF the problem is gone, i.e., following
code compiles fine. gcc-2.95.3 does not have this bug.
class test
{
public:
typedef bool (test::*ResponseFunc)(char*);
typedef bool RF(char*);
struct Command {
ResponseFunc respFunc;
};
bool setLosSwd(char*);
bool getLosSwd(char*);
bool printHelp(char*);
static Command d_cmdTable[];
};
test::Command test::d_cmdTable[] = {
{&test::setLosSwd},
{&test::getLosSwd},
{&test::printHelp}
};
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list