[Bug c++/86256] Lambda will not add ref count for class intelligent pointer member when capture 'this' or & as argument
kangchuanbo at 126 dot com
gcc-bugzilla@gcc.gnu.org
Sun Jun 24 03:06:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86256
--- Comment #2 from kangchuanbo at 126 dot com ---
Once Lamdba capture this ( one class instance which have std::shared_ptr<>
member), the std::shared_ptr member will not increase ref count inside Lambda
body, this is dangerous, once this member has been freed, the Lambda body will
access null pointer.
At 2018-06-21 19:47:22, "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86256
>
>Jonathan Wakely <redi at gcc dot gnu.org> changed:
>
> What |Removed |Added
>----------------------------------------------------------------------------
> Status|UNCONFIRMED |WAITING
> Last reconfirmed| |2018-06-21
> Ever confirmed|0 |1
>
>--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
>N.B. GCC 5.4 is no longer supported or maintained.
>
>I don't understand your bug report, GCC is compiling the code correctly.
>
>What do you think should happen?
>
>--
>You are receiving this mail because:
>You reported the bug.
More information about the Gcc-bugs
mailing list