[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2014-09-17 Thread gromer at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 --- Comment #6 from Geoff Romer gromer at google dot com --- A Chromium maintainer privately pointed out a use case that would be thwarted by a check like this: basically, unique_ptr is used to hold pointers from a legacy API, using a custom

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2014-09-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread gromer at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 Geoff Romer gromer at google dot com changed: What|Removed |Added CC||gromer at google

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 --- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org --- What if the deleter doesn't actually destroy the object, and doing self-reset is used as a crazy way to trigger the deleter to do something with the pointer, but not to alter the

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 --- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org --- I'm also a little concerned that doing a self-reset followed by release() is indeed valid ... but probably rare enough that we can still assert anyway at the time of the self-reset.

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread gromer at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 --- Comment #3 from Geoff Romer gromer at google dot com --- What's the standard of review here? If we can only assert on undefined behavior, even in debug mode, then this just can't be done (although maybe we should make this undefined in the

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 --- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org --- I think all existing Debug Mode checks only trigger for genuine undefined behaviour

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for self-reset

2013-08-14 Thread ppluzhnikov at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159 Paul Pluzhnikov ppluzhnikov at google dot com changed: What|Removed |Added CC|