From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32623 invoked by alias); 18 Dec 2001 01:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32593 invoked by uid 71); 18 Dec 2001 01:06:02 -0000 Resent-Date: 18 Dec 2001 01:06:02 -0000 Resent-Message-ID: <20011218010602.32592.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, gcurran@gte.net Received:(qmail 31889 invoked by uid 61); 18 Dec 2001 01:03:00 -0000 Message-Id:<20011218010259.31887.qmail@sources.redhat.com> Date: Mon, 17 Dec 2001 17:06:00 -0000 From: gcurran@gte.net Reply-To: gcurran@gte.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5144: ICE on const_hash X-SW-Source: 2001-12/txt/msg00947.txt.bz2 List-Id: >Number: 5144 >Category: c++ >Synopsis: ICE on const_hash >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Mon Dec 17 17:06:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: George Curran >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: Suse Linux ver 7.1 pentium 300Mhz, 96M ram >Description: viffer@linux:~/cpp.21days > c++ lst14.11.cpp -o example lst14.11.cpp: In function `int main(...)': lst14.11.cpp:30: Internal compiler error in `const_hash', at varasm.c:2372 Please submit a full bug report. See for instructions. attempting to compile program 14.11 in "Teach Yourself C++ Programming in 21 Days" by Jesse Liberty. Sams Publishing >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="lst14.11.cpp" Content-Disposition: inline; filename="lst14.11.cpp" // listing 14.11 array of pointers to member functions #include enum BOOL {FALSE, TRUE}; class Dog { public: void Speak() const {cout << "Woof!\n";} void Move() const {cout << "Walking to heel. . .\n";} void Eat() const {cout << "Gobbling food. . .\n";} void Growl() const {cout << "Grrrr!\n";} void Whimper() const {cout << "Whining noises. . .\n";} void RollOver() const {cout << "Rolling over. . .\n";} void PlayDead() const {cout << "Is this the end of Little Caeser?\n";} }; typedef void (Dog::*PDF)()const ; void main() { const int MaxFuncs = 7; PDF DogFunctions[MaxFuncs] = { &Dog::Speak, &Dog::Move, &Dog::Eat, &Dog::Growl, &Dog::Whimper, &Dog::RollOver, &Dog::PlayDead}; Dog* pDog =0; int Method; BOOL fQuit = FALSE; while (!fQuit) { cout << "(0)Quit (1)Speak (2)Move (3)Eat (4)Growl"; cout << "(5)Whimper (6)Roll Over (7)Play Dead: "; cin >> Method if (Method == 0) { fQuit = TRUE; break; } else { pDog = new Dog; (pDog->*DogFunctions[Method-1])(); delete pDog; } } }