This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17006] New: unused variable warning only shown on existing constructor


The following code gives this warning:

62 C:\Dev-Cpp\Projects\gcc-test\main.cpp
[Warning] unused variable 'x'

If you uncomment the constructor, the warning does not appear.

class Test
{
    public:        
    //Test() {}
};

int main(int argc, char *argv[])
{
	Test x;
	
  	return 0;
}

Happened on Windows 2000 SP4 with gcc-3.4.1-20040711-1, mingw-
runtime-3.3 and win32api-2.5.
Compiled with "-Wunused".

-- 
           Summary: unused variable warning only shown on existing
                    constructor
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oliverst at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]