From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25882 invoked by alias); 14 Aug 2012 16:26:11 -0000 Received: (qmail 25848 invoked by uid 22791); 14 Aug 2012 16:26:08 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 16:25:55 +0000 From: "oleg at smolsky dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54259] New: Regression in move construction for std::pair Date: Tue, 14 Aug 2012 16:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: oleg at smolsky dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: 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-08/txt/msg00872.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54259 Bug #: 54259 Summary: Regression in move construction for std::pair Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: oleg@smolsky.net I've just attempted to move my project from g++ v4.6.3 to v4.7.1 and hit an issue when using move semantics. I have a templated class LockGuard that is move-constructable and not copyable. This is accomplished (in the conventional C++98 way) by making the copy constructor "private". The code creates an instance of std::pair<..., LockGuard<...>> and returns it to the caller. The code compiles and runs on g++ 4.6.3 and VS2010/sp1, yet g++ 4.7.1 emits a bunch of errors (below). The point, as far as I can tell, is that it wants to call the copy constructor which is private. I can fix the issue by explicitly removing the copy constructor: LockGuard(const LockGuard &) = delete; Could someone clarify if this behavior is conforming to the standard? Normally I would not worry about such a thing, but VS2010 does not understand "= delete" specs and the behavior appears to be a breaking change w.r.t. copy constructor invocations... (well, breaking is too strong a word as move constructors and rvalue references are new, but I am sure you see what I mean)