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++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55043

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-24 01:08:13 UTC ---
It already does use move_if_noexcept, so should work.

The problem is that
std::is_copy_constructible<std::unordered_set<std::unique_ptr<int>>>::value is
true, so __move_if_noexcept_cond is true for unordered containers and we try to
copy them.

That happens because this is well-formed:

    typedef std::unordered_set<std::unique_ptr<int>> S;
    decltype(::new S(std::declval<const S&>())) s;

That should be ill-formed, but for some reason isn't when it occurs as an
unevaluated operand.

This is ill-formed, as expected:

    S ss;
    ::new S(static_cast<const S&>(ss));


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