public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58659] Construction of shared_ptr from unique_ptr mismatches new/delete and std::allocator for __shared_ptr_count
Date: Tue, 08 Oct 2013 13:38:00 -0000	[thread overview]
Message-ID: <bug-58659-4-1XCfKwzl2y@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58659-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Oct  8 13:38:21 2013
New Revision: 203277

URL: http://gcc.gnu.org/viewcvs?rev=203277&root=gcc&view=rev
Log:
    PR libstdc++/58659
    * include/bits/shared_ptr_base.h (__shared_count::__shared_count(P,D)):
    Delegate to constructor taking allocator.
    (__shared_count::_S_create_from_up): Inline into ...
    (__shared_count::__shared_count(unique_ptr<Y,D>&&): Here. Use
    std::conditional instead of constrained overloads. Allocate memory
    using the allocator type that will be used for deallocation.
    * testsuite/20_util/shared_ptr/cons/58659.cc: New.
    * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust.

Added:
   
branches/gcc-4_8-branch/libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc
Modified:
    branches/gcc-4_8-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_8-branch/libstdc++-v3/include/bits/shared_ptr_base.h
   
branches/gcc-4_8-branch/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc


  parent reply	other threads:[~2013-10-08 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 21:16 [Bug libstdc++/58659] New: " spencer at starscale dot com
2013-10-07 21:36 ` [Bug libstdc++/58659] " redi at gcc dot gnu.org
2013-10-08 12:33 ` redi at gcc dot gnu.org
2013-10-08 13:38 ` redi at gcc dot gnu.org [this message]
2013-10-08 13:43 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58659-4-1XCfKwzl2y@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).