This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/50641] [c++0x] is_convertible and is_constructible incorrectly require copy constructibility


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]