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

            Bug ID: 70881
           Summary: -Wunused-parameter incorrect for macro case
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ian at geometrian dot com
  Target Milestone: ---

Created attachment 38380
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38380&action=edit
Simple example.

In the attached example, adapted from real-world image-processing code, a macro
is used to paste a case statement that contains a parameter.  However,
-Wunused-parameter reports that it is not used, erroneously.

Produces:
macro-example.cpp: In function 'ImageBase* get_new_diffabs(const ImageBase*,
const ImageBase*)':
35 : warning: unused parameter 'img1' [-Wunused-parameter]

Reply via email to