public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54259] New: Regression in move construction for std::pair
@ 2012-08-14 16:26 oleg at smolsky dot net
  2012-08-14 16:27 ` [Bug libstdc++/54259] " oleg at smolsky dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: oleg at smolsky dot net @ 2012-08-14 16:26 UTC (permalink / raw)
  To: gcc-bugs

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)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-12-05 13:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 16:26 [Bug libstdc++/54259] New: Regression in move construction for std::pair oleg at smolsky dot net
2012-08-14 16:27 ` [Bug libstdc++/54259] " oleg at smolsky dot net
2012-08-14 16:52 ` redi at gcc dot gnu.org
2012-08-14 21:09 ` oleg at smolsky dot net
2012-08-15  9:02 ` [Bug c++/54259] [4.7 Regression] " rguenth at gcc dot gnu.org
2012-08-15 14:46 ` redi at gcc dot gnu.org
2012-09-20 10:22 ` jakub at gcc dot gnu.org
2012-12-03 15:41 ` rguenth at gcc dot gnu.org
2012-12-05 13:19 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).