public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails
@ 2011-03-14 14:02 martin.kronbichler at it dot uu.se
  2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: martin.kronbichler at it dot uu.se @ 2011-03-14 14:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113

           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=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure --enable-languages=c,c++,fortran,objc,obj-c++,go
--prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --without-included-gettext
--enable-threads=posix --program-suffix=-4.6 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror
--with-arch-32=i486 --with-tune=core2 --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-cpu=core2
Thread model: posix
gcc version 4.6.0 20110312 (experimental) (GCC) 

(weekly snapshot on x86_64)


On the following code:

#include <functional>
void test_1 (std::tuple<int>);
void test (int tst) {
  const std::function<void()> fun (std::bind(&test_1, std::tuple<int>(tst)));
};

with the command line "g++-4.6 -std=c++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/functional:
In static member function ‘static void std::_Function_handler<void(_ArgTypes
...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor
= std::_Bind<void (*(std::tuple<int>))(std::tuple<int>)>, _ArgTypes = {}]’:
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:2135:6:
  instantiated from ‘std::function<_Res(_ArgTypes ...)>::function(_Functor,
typename std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type) [with _Functor =
std::_Bind<void (*(std::tuple<int>))(std::tuple<int>)>, _Res = void, _ArgTypes
= {}, typename std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type =
std::function<void()>::_Useless]’
bind_test.cc:6:76:   instantiated from here
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
error: no matching function for call to ‘std::tuple<int>::tuple(const volatile
std::tuple<int>&)’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional: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<class _U1> 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<class _U1> 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 = int,
std::tuple<_T1> = std::tuple<int>]
/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 ‘const volatile
std::tuple<int>’ to ‘std::tuple<int>&&’
/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 = int,
std::tuple<_T1> = std::tuple<int>]
/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 ‘const volatile
std::tuple<int>’ to ‘const std::tuple<int>&’
/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 = 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/functional:1765:9:
error: no matching function for call to ‘std::tuple<int>::tuple(volatile
std::tuple<int>&)’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional: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<class _U1> 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<class _U1> 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 = int,
std::tuple<_T1> = std::tuple<int>]
/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 ‘volatile std::tuple<int>’ to
‘std::tuple<int>&&’
/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 = int,
std::tuple<_T1> = std::tuple<int>]
/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 ‘volatile std::tuple<int>’ to
‘const std::tuple<int>&’
/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 = 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=c++0x argument).


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-03-16 20:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
2011-03-14 14:19 ` [Bug libstdc++/48113] [4.6 Regression] " redi at gcc dot gnu.org
2011-03-14 14:26 ` [Bug libstdc++/48113] [4.6/4.7 " rguenth at gcc dot gnu.org
2011-03-14 16:23 ` redi at gcc dot gnu.org
2011-03-14 17:24 ` jason at gcc dot gnu.org
2011-03-14 17:34 ` jason at gcc dot gnu.org
2011-03-14 17:56 ` paolo.carlini at oracle dot com
2011-03-14 18:02 ` redi at gcc dot gnu.org
2011-03-14 18:04 ` redi at gcc dot gnu.org
2011-03-14 18:10 ` redi at gcc dot gnu.org
2011-03-14 18:48 ` [Bug c++/48113] " jason at gcc dot gnu.org
2011-03-14 18:59 ` redi at gcc dot gnu.org
2011-03-16 20:03 ` jason at gcc dot gnu.org
2011-03-16 20:04 ` jason at gcc dot gnu.org
2011-03-16 20:24 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).