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

             Bug #: 55203
           Summary: No unused warning for variables of non-trivial types
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: l.lu...@suse.cz


GCC warns about unused variables e.g. of type 'int', but not 'std::string' :

$ cat a.cpp
#include <string>

void foo()
    {
    int i;
    std::string s;
    }
$ g++ -Wall -Wunused -c a.cpp
a.cpp: In function ‘void foo()’:
a.cpp:5:9: warning: unused variable ‘i’ [-Wunused-variable]
     int i;
         ^

In the function 's' is apparently unused too, but the compiler cannot tell it.

Reply via email to