Here's a minimalistic example:

#include <memory>

struct A : std::enable_shared_from_this< A > {};

int main()
{
  std::make_shared< A >()->shared_from_this();
}

It throws a bad_weak_ptr exception, which is AFAICT wrong.


-- 
           Summary: [C++0x] make_shared does not initialize
                    enable_shared_from_this' internal shared_count
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot frey at gmx dot de


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

Reply via email to