public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59603] New: std::random_shuffle tries to swap element with itself
@ 2013-12-26 16:36 fab at orlen dot de
  2013-12-26 16:37 ` [Bug libstdc++/59603] " fab at orlen dot de
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: fab at orlen dot de @ 2013-12-26 16:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59603
           Summary: std::random_shuffle tries to swap element with itself
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fab at orlen dot de

When using the debugging macro _GLIBCXX_DEBUG, calling random_shuffle fails on
some types, because it might try to swap an element with itself.

Output of attached program:

/tmp$ g++ -o random_shuffle_bug -std=c++11 random_shuffle_bug.cc 
/tmp$ ./random_shuffle_bug 
/usr/include/c++/4.8.2/debug/vector:159:error: attempt to self move assign.

Objects involved in the operation:
sequence "this" @ 0x0xa600c8 {
  type = NSt7__debug6vectorIiSaIiEEE;
}
Aborted (core dumped)

return code: 134

I could not find any information about whether swapping an element with itself
is allowed.


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

end of thread, other threads:[~2015-09-16 11:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-26 16:36 [Bug libstdc++/59603] New: std::random_shuffle tries to swap element with itself fab at orlen dot de
2013-12-26 16:37 ` [Bug libstdc++/59603] " fab at orlen dot de
2014-02-04  8:38 ` joerg.richter@pdv-fs.de
2014-02-04 13:10 ` redi at gcc dot gnu.org
2014-02-08 20:19 ` redi at gcc dot gnu.org
2014-02-09 17:31 ` joerg.richter@pdv-fs.de
2014-02-10 19:00 ` redi at gcc dot gnu.org
2014-09-12 11:45 ` redi at gcc dot gnu.org
2014-09-12 13:31 ` redi at gcc dot gnu.org
2014-09-12 13:35 ` redi at gcc dot gnu.org
2014-12-06 20:38 ` redi at gcc dot gnu.org
2014-12-06 22:04 ` redi at gcc dot gnu.org
2015-09-16 11:37 ` TonyELewis at hotmail 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).