This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50641] [c++0x] is_convertible and is_constructible incorrectly require copy constructibility
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Oct 2011 05:36:02 +0000
- Subject: [Bug libstdc++/50641] [c++0x] is_convertible and is_constructible incorrectly require copy constructibility
- Auto-submitted: auto-generated
- References: <bug-50641-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50641
--- Comment #2 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2011-10-07 05:36:02 UTC ---
1) The outcome of is_constructible is expected, because you cannot construct
From from To, the actually wanted test would have been
static_assert(std::is_constructible<To, From>::value, "not constructible");
and this is correctly accepted.
2) The outcome of is_convertible is expected, because this traits is just a
trait to test for copy-initialization. Just add the line
To t2 = create<From>();
to your test function and this will fail too:
"error: use of deleted function 'To::To(const To&)"
This is expected because the current language requires that a temporary of the
target type To will be created which is than moved/copied into the final To
object. Alas, this must fail, because To does not have any copy constructor not
move constructor.
This looks like not-a-bug to me.