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 01:24:02 +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
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-24 01:24:02 UTC ---
The problem reduces to this:
#include <type_traits>
#include <utility>
struct M {
M(M&&) { }
};
template<typename T>
struct U
{
U(const U& n) : m(n.m) { }
U(U&& n);
T m;
};
static_assert( std::is_copy_constructible<U<M>>::value, "huh?" );
We need that static_assertion to fail because the type is *not* copy
constructible.
But it passes, because this compiles OK:
decltype(::new U<M>(std::declval<const U<M>&>())) n;
Even though the definition of U(const U&) is ill-formed for a non-copyable
template argument, using that constructor as an unevaluated operand compiles
OK.
Daniel, is this a bug in is_constructible?