This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Missing warning...
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Missing warning...
- From: ao at infinet dot com
- Date: Thu, 27 Jan 2000 08:37:43 -0500 (EST)
Hi,
The following code fragment fails to warn about using an uninitialised
variable, which I believe it should. While the code is obviously
incorrect, a similar piece of code took me a while to track down
because the two variable names were almost identical.
The "bug" occurs in 2.95.2, both the solaris2.6(ultrasparc) and Linux
2.2(intel) versions.
/Mike
class foo
{
public:
virtual void fn();
};
class bar : public foo
{
public:
virtual void fn();
int fn2();
};
int bug_fn(foo& x)
{
bar& var = dynamic_cast<bar&>(var);
return var.fn2();
};