This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/57139] New: std::tuple conversion constructor does the wrong checks
- From: "vpozdyayev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 01 May 2013 19:03:09 +0000
- Subject: [Bug libstdc++/57139] New: std::tuple conversion constructor does the wrong checks
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57139
Bug #: 57139
Summary: std::tuple conversion constructor does the wrong
checks
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: vpozdyayev@gmail.com
As per Std 20.4.2.1/14, the "template <class... UTypes> tuple(const
tuple<UTypes...>& u)" constructor should require "is_constructible<Ti, const
Ui&>". However, the implementation checks "is_convertible<const _UElements&,
_Elements>", which implies copy constructibility requirement for destination
types. As a result:
#include <type_traits>
#include <tuple>
class A { };
class B { public: B( A const &a ) { } private: B( B const & ); };
static_assert( std::is_constructible< B, A const & >::value, "test" ); // OK
static_assert( std::is_convertible< A, B >::value, "test" ); // fail
static_assert( std::is_constructible< std::tuple<B>, std::tuple<A> >::value,
"test" ); // fail