From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hao Li To: gcc-gnats@gcc.gnu.org Cc: Hao Li Subject: c++/3274: gcc-3.0 bug Date: Tue, 19 Jun 2001 17:26:00 -0000 Message-id: <200106200017.f5K0H1f25103@lexus.onetta.com> X-SW-Source: 2001-06/msg00803.html List-Id: >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: