This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17006] New: unused variable warning only shown on existing constructor
- From: "oliverst at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Aug 2004 16:52:09 -0000
- Subject: [Bug c++/17006] New: unused variable warning only shown on existing constructor
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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