From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9220 invoked by alias); 14 Mar 2011 14:02:54 -0000 Received: (qmail 9043 invoked by uid 22791); 14 Mar 2011 14:02:50 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BJ,TW_CX,TW_DC 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; Mon, 14 Mar 2011 14:02:45 +0000 From: "martin.kronbichler at it dot uu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: martin.kronbichler at it dot uu.se 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" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Mon, 14 Mar 2011 14:02:00 -0000 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-03/txt/msg01404.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48113 Summary: [C++0x] bind with tuple argument fails Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: martin.kronbichler@it.uu.se Compiler version: $ gcc-4.6 -v Using built-in specs. COLLECT_GCC=3Dgcc-4.6 COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper Target: x86_64-linux-gnu Configured with: ../configure --enable-languages=3Dc,c++,fortran,objc,obj-c= ++,go --prefix=3D/usr --libexecdir=3D/usr/lib --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --without-included-gettext --enable-threads=3Dposix --program-suffix=3D-4.6 --enable-nls --enable-cloc= ale=3Dgnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=3Di486 --with-tune=3Dcore2 --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linu= x-gnu --with-cpu=3Dcore2 Thread model: posix gcc version 4.6.0 20110312 (experimental) (GCC)=20 (weekly snapshot on x86_64) On the following code: #include void test_1 (std::tuple); void test (int tst) { const std::function fun (std::bind(&test_1, std::tuple(tst))= ); }; with the command line "g++-4.6 -std=3Dc++0x -c bind_test.cc -o bind_tst.o",= I get the following error message: In file included from bind_test.cc:2:0: /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l: In static member function =E2=80=98static void std::_Function_handler::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Fun= ctor =3D std::_Bind))(std::tuple)>, _ArgTypes =3D {= }]=E2=80=99: /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l:2135:6: instantiated from =E2=80=98std::function<_Res(_ArgTypes ...)>::function(_= Functor, typename std::enable_if<(! std::is_integral<_Functor>::value), std::function<_Res(_ArgTypes ...)>::_Useless>::type) [with _Functor =3D std::_Bind))(std::tuple)>, _Res =3D void, _Arg= Types =3D {}, typename std::enable_if<(! std::is_integral<_Functor>::value), std::function<_Res(_ArgTypes ...)>::_Useless>::type =3D std::function::_Useless]=E2=80=99 bind_test.cc:6:76: instantiated from here /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l:1765:9: error: no matching function for call to =E2=80=98std::tuple::tuple(con= st volatile std::tuple&)=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l:1765:9: note: candidates are: /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:441= :32: note: template std::tuple<_T1>::tuple(std::tuple<_U1>&&) /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:437= :37: note: template std::tuple<_T1>::tuple(const std::tuple<_U1>&) /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433= :7: note: std::tuple<_T1>::tuple(std::tuple<_T1>&&) [with _T1 =3D int, std::tuple<_T1> =3D std::tuple] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433= :7: note: no known conversion for argument 1 from =E2=80=98const volatile std::tuple=E2=80=99 to =E2=80=98std::tuple&&=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431= :17: note: constexpr std::tuple<_T1>::tuple(const std::tuple<_T1>&) [with _T1 = =3D int, std::tuple<_T1> =3D std::tuple] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431= :17: note: no known conversion for argument 1 from =E2=80=98const volatile std::tuple=E2=80=99 to =E2=80=98const std::tuple&=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418= :17: note: constexpr std::tuple<_T1>::tuple() [with _T1 =3D int] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418= :17: note: candidate expects 0 arguments, 1 provided /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l:1765:9: error: no matching function for call to =E2=80=98std::tuple::tuple(vol= atile std::tuple&)=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functiona= l:1765:9: note: candidates are: /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:441= :32: note: template std::tuple<_T1>::tuple(std::tuple<_U1>&&) /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:437= :37: note: template std::tuple<_T1>::tuple(const std::tuple<_U1>&) /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433= :7: note: std::tuple<_T1>::tuple(std::tuple<_T1>&&) [with _T1 =3D int, std::tuple<_T1> =3D std::tuple] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433= :7: note: no known conversion for argument 1 from =E2=80=98volatile std::tupl= e=E2=80=99 to =E2=80=98std::tuple&&=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431= :17: note: constexpr std::tuple<_T1>::tuple(const std::tuple<_T1>&) [with _T1 = =3D int, std::tuple<_T1> =3D std::tuple] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431= :17: note: no known conversion for argument 1 from =E2=80=98volatile std::tupl= e=E2=80=99 to =E2=80=98const std::tuple&=E2=80=99 /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418= :17: note: constexpr std::tuple<_T1>::tuple() [with _T1 =3D int] /usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418= :17: note: candidate expects 0 arguments, 1 provided Since I can't see anything illegal with the code, my guess is that it is a problem with the C++0x headers (the compilation is fine with gcc 4.5.2 with -std=3Dc++0x argument).