With -Wunused, this:

struct A { A(int); };
struct S { S(A); };
void f()
{
    int i = 0;
    S s(A(i));
}

generates a spurious warning:

test.cpp: In function `void f()':
test.cpp:5: warning: unused variable `int i'

(Happens in Debian's 3.3.5-12, 3.4.3-12, 4.0-0pre9)

-- 
           Summary: -Wunused warns for variable passed to constructor via
                    function-style cast
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: timb at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-linux
  GCC host triplet: i486-linux
GCC target triplet: i486-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20796

Reply via email to