This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54351] ~unique_ptr() should not set stored pointer to null
- From: "gromer at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Dec 2012 21:59:23 +0000
- Subject: [Bug libstdc++/54351] ~unique_ptr() should not set stored pointer to null
- Auto-submitted: auto-generated
- References: <bug-54351-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54351
--- Comment #11 from Geoff Romer <gromer at google dot com> 2012-12-18 21:59:23 UTC ---
>From discussion on the C++ LWG reflector, it appears that the standard's
requirements on library types are intended to apply only during their lifetime,
although the standard does not currently make this clear. LWG 2224
(http://cplusplus.github.com/LWG/lwg-active.html#2224) is tracking this issue,
and its resolution should give a definitive answer.
That being the case, the old behavior was not a bug, but conformant with the
the intent of the standard (if not the precise wording). The new behavior is
conformant as well, of course, so it's up to you whether to revert the changes;
I just wanted to document for future reference that ~unique_ptr is in fact
permitted to modify the stored pointer before invoking the deleter, so this bug
report should not be an obstacle to e.g. having ~unique_ptr store a poison
value in order to catch client bugs.