From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 752 invoked by alias); 6 May 2004 18:36:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 743 invoked by uid 48); 6 May 2004 18:36:04 -0000 Date: Thu, 06 May 2004 18:36:00 -0000 From: "rjpeters at klab dot caltech dot edu" To: gcc-bugs@gcc.gnu.org Message-ID: <20040506183602.15329.rjpeters@klab.caltech.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15329] New: ICE on constructor of member template X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg00634.txt.bz2 List-Id: This code produces an ICE with g++-3.4.0 class Canvas { public: typedef void (Canvas::* Manip)(); template class Saver { public: Saver(Canvas& canvas) : itsCanvas(canvas) { (itsCanvas.*doit)(); // ICE occurs here; no ICE if 'canvas' is used instead of 'itsCanvas' } private: Canvas& itsCanvas; }; }; Specs: [sideswipe 18:20 52]$ /usr/local/gcc-3.4.0/bin/g++ -v Reading specs from /usr/local/gcc-3.4.0/lib/gcc/i686-pc-linux-gnu/3.4.0/specs Configured with: /home/rjpeters/build/gcc-3.4.0/configure --prefix=/usr/local/gcc-3.4.0 --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.4.0 There is no ICE with g++-3.3.2 for the same code and as far as I can recall there has been no problem with this same code as I upgraded through all successive versions including 3.1.x, 3.2.x, and 3.3.x. There is no ICE if the problem line uses the function argument 'canvas' rather than the member variable 'itsCanvas' as the callee of the ptr-to-memfunc. There is no ICE if the problem line is changed to a direct member-function call rather than a call through a ptr-to-memfunc and in this case the nested class is not a template class: class Canvas { public: void foo(); class Saver { public: Saver(Canvas& canvas) : itsCanvas(canvas) { itsCanvas.foo(); // no ICE here in this case } private: Canvas& itsCanvas; }; }; -Rob Peters -- Summary: ICE on constructor of member template Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rjpeters at klab dot caltech dot edu CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15329