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)

Reply via email to