This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Oct 2012 08:25:04 +0000
- Subject: [Bug libstdc++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector
- Auto-submitted: auto-generated
- References: <bug-55043-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55043
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-24 08:25:04 UTC ---
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > is this a bug in is_constructible?
> >
> > I don't think so. The implementation of the copy constructor is irrelevant,
> > only the prototype matters to determine copy-constructibility.
>
> I agree with Marc, the trait can only test what the compile-time interface
> says.
That seems inconsistent with 20.9.4.3/6
the predicate condition for a template specialization is_constructible<T,
Args...> shall be satisfied if and only if the following variable definition
would be well-formed for some invented variable t:
T t(create<Args>()...);
and that variable definition is not well-formed:
const N<M>& create();
N<M> t(create());
u.cc: In instantiation of âN<T>::N(const N<T>&) [with T = M]â:
u.cc:17:16: required from here
u.cc:11:24: error: use of deleted function âconstexpr M::M(const M&)â
N(const N& n) : m(n.m) { }
^
I guess the solution is to add enable_if-style constraints to the copy
constructors, everywhere.