From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5315 invoked by alias); 29 Jul 2014 15:13:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22722 invoked by uid 48); 29 Jul 2014 14:40:15 -0000 From: "moblaza at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61951] New: -wExtra switch produce warning: parameter 'ptr' set but not used [-Wunused-but-set-parameter] Date: Tue, 29 Jul 2014 15:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: moblaza at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01914.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61951 Bug ID: 61951 Summary: -wExtra switch produce warning: parameter 'ptr' set but not used [-Wunused-but-set-parameter] Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: moblaza at gmail dot com Created attachment 33204 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33204&action=edit program with this code example Hello! Il write code example with lambda expression, with operator new class allocation, and g++ produce warning: D:\workspace\gcc_test1\main.cpp:33:67: warning: parameter 'ptr' set but not used [-Wunused-but-set-parameter] std::for_each(ref.begin(), ref.end(), [](Base* ptr){ but after allocation, lambda parameter is used also in lambda expression with for_each algorithm. See attached code. PS. My: gcc version 4.8.1 (rev5, Built by MinGW-W64 project)