https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61951

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Is there anything wrong on the warning though?

[](Base* ptr){ ptr = new Deliv(); }

I think ptr here is lambda parameter, does it behave any different from
parameter to any other function?
void foo (Base* ptr) { ptr = new Deliv(); }
warns about parameter 'ptr' set but not used intentionally, so why shouldn't it
we warn about it in the lambda?  Doesn't the lambda just leak memory and not
actually store the pointer anywhere (it stores it into the parameter which is
never used)?

Reply via email to