From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12458 invoked by alias); 22 Nov 2011 05:58:09 -0000 Received: (qmail 12450 invoked by uid 22791); 22 Nov 2011 05:58:07 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX,TW_DC,TW_JL,TW_YM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 05:57:54 +0000 From: "i.nixman at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 Date: Tue, 22 Nov 2011 08:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i.nixman at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-11/txt/msg02176.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51265 Bug #: 51265 Summary: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: i.nixman@gmail.com When I try to compile following code, I get error: test1.cpp: In instantiation of 'void xx(T*, A ...) [with X = int (Funny::*)(int) const; X ff = &Funny::print3; R = int; T = Funny; A = {int}]': test1.cpp:35:74: required from here test1.cpp:23:9: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 code: #include struct Funny { void print(int i) { std::cout << "void (Funny::*)(int): " << i << std::endl; } int print2(int i) { std::cout << "int (Funny::*)(int): " << i << std::endl; return i; } int print3(int i) const { std::cout << "int (Funny::*)(int) const: " << i << std::endl; return i; } }; template void c(){ T abc; (abc.*ff)(123); } template void xx(T* _obj, A... args){ for (int i : {2,4}) std::cout << i << std::endl; // #3 int i is OK { /* 23 */ c(); // #1 summary error trigger here } std::cout << "xx()" << std::endl; (_obj->*(ff))(args...); // #2 can not define any object here, even int // T abc; //(abc.*ff)(args...); } int main() { Funny abc; /* 35 */ xx(&abc, 3); return 0; } configured with: C:\test>g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrappe r.exe Target: i686-pc-mingw32 Configured with: ../../mingw-src/gcc-trunk/configure --host=i686-pc-mingw32 --bu ild=i686-pc-mingw32 --target=i686-pc-mingw32 --prefix=/mingw-sjlj-x86 --with-arc h=i686 --with-tune=generic --enable-languages=c,c++,lto,fortran,objc,obj-c++ --w ith-host-libstdcxx=-lstdc++ --disable-shared --enable-static --enable-cxx-flags= '-fno-function-sections -fno-data-sections' --enable-libstdcxx-time=yes --enable -libgomp --enable-lto --enable-graphite --enable-cloog-backend=isl --enable-chec king=release --enable-fully-dynamic-string --enable-threads=posix --disable-libs tdcxx-pch --enable-libstdcxx-debug --enable-sjlj-exceptions --disable-debug --di sable-bootstrap --disable-multilib --disable-rpath --disable-win32-registry --di sable-nls --disable-werror --disable-symvers --with-gmp=/mingw-libs --with-mpfr= /mingw-libs --with-mpc=/mingw-libs --with-ppl=/mingw-libs --with-cloog=/mingw-li bs --with-libiconv-prefix=/mingw-libs --with-pkgversion='niXman build' Thread model: posix