From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10627 invoked by alias); 12 May 2007 02:51:11 -0000 Received: (qmail 10563 invoked by uid 48); 12 May 2007 02:50:58 -0000 Date: Sat, 12 May 2007 02:51:00 -0000 Subject: [Bug c++/31905] New: ICE with typeof(&T::method2) X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "blaisorblade_spam at yahoo dot it" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00874.txt.bz2 I get an ICE when instantiating the following template: template typeof(&T::method2) method2_of(T) { return &T::method2; } Note that both '&' are needed, as well as instantiating this template on a type having a ::method2 member function. If I omit any of them, I get just various error messages. ==bug.cpp== struct Foo { void method2(int) { } }; template typeof(&T::method2) method2_of(T) { return &T::method2; } int main() { Foo a; method2_of(a); } ==end== $ g++ -c bug.cpp bug.cpp: In function ‘__typeof__ (& T::method2) method2_of(T) [with T = Foo]’: bug.cpp:9: internal compiler error: in write_type, at cp/mangle.c:1651 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. For Debian GNU/Linux specific bug reporting instructions, see . Preprocessed source stored into /tmp/ccSj6aeQ.out file, please attach this to your bugreport. $ g++ -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu Thread model: posix gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) Command line of cc1plus: // /usr/lib/gcc/x86_64-linux-gnu/4.1.2/cc1plus -quiet -D_GNU_SOURCE bug.cpp -quiet -dumpbase bug.cpp -mtune=generic -auxbase bug -fstack-protector -fstack-protector -o - -frandom-seed=0 -- Summary: ICE with typeof(&T::method2) Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: blaisorblade_spam at yahoo dot it GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31905