[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug or a feature
From: |
Anakreon |
Subject: |
bug or a feature |
Date: |
Mon, 04 Jul 2005 19:05:10 +0300 |
User-agent: |
Debian Thunderbird 1.0.2 (X11/20050602) |
I'm not sure this is a bug in g++ because is too obvious.
===========code===========
class bug {
private:
int mem;
public:
void meth1();
void meth2();
};
/*
g++ (GCC) 3.3.5 (Debian 1:3.3.5-13)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
int main(int, char**) {
//this should be an error
bug bg;
//if the line bellow is uncommented the linker catches the error
//bg.meth1();
return 1;
}
===========code==============
When I compile this file no warnings are produced.
If I compile with the -Wall flag the only warning is:
gcc_bug.cpp: In function `int main(int, char**)':
gcc_bug.cpp:18: warning: unused variable `bug bg'
I think the compiler ought to stop the compilation with an error
since the 2 methods of the bug class are not implemented.
At least a warning should be produced.
If this is not a feature, I'll make a proper bug submission
Anakreon