[Bug c++/54047] New: unused variable warning not for std::string

plasmahh at gmx dot net gcc-bugzilla@gcc.gnu.org
Fri Jul 20 11:52:00 GMT 2012


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

             Bug #: 54047
           Summary: unused variable warning not for std::string
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: plasmahh@gmx.net


Compiling the following code:

#include <string>

struct A { };

void foo()
{
        A z;
        std::string z0;
}


I get a warning for unused variable z, but not for variable z0. It seems that
std::string is somehow magical here, but I can't see how or why.



More information about the Gcc-bugs mailing list