From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20360 invoked by alias); 24 Oct 2012 01:08:28 -0000 Received: (qmail 20309 invoked by uid 48); 24 Oct 2012 01:08:14 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector Date: Wed, 24 Oct 2012 01:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg02137.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55043 --- Comment #7 from Jonathan Wakely 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>>::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> S; decltype(::new S(std::declval())) 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(ss));