[Bug c++/86256] Lambda will not add ref count for class intelligent pointer member when capture 'this' or & as argument

2018-06-24 Thread kangchuanbo at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86256 --- Comment #4 from kangchuanbo at 126 dot com --- OK, thanks for your response, I just met this issue and think it's better to give warn or error when Lambda capture this or reference with std::shared_ptr member inside. So add one Lambda usage

[Bug c++/86256] Lambda will not add ref count for class intelligent pointer member when capture 'this' or & as argument

2018-06-23 Thread kangchuanbo at 126 dot com
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

[Bug c++/86256] New: Lambda will not add ref count for class intelligent pointer member when capture 'this' or & as argument

2018-06-20 Thread kangchuanbo at 126 dot com
atus: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kangchuanbo at 126 dot com Target Milestone: --- For example: #include #include class A { public: A(){ tmp = std::make_shar