This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
calling 'xxx' like a member
- To: egcs-bugs at cygnus dot com
- Subject: calling 'xxx' like a member
- From: Haakon Innerdal <hakoni at funcom dot com>
- Date: Thu, 2 Jul 1998 10:53:34 +0200 (MET DST)
Header file foo.h:
class foo {
public:
foo() { }
};
Header file bar.h:
class bar {
public:
bar() { }
foo() { }
};
main.cpp:
#include "foo.h"
#include "bar.h"
main()
{
foo testfoo;
bar testbar;
testbar.foo();
}
This causes an error like this:
main.cpp: In function `int main()':
main.cpp:9: calling type `foo' like a method
This is a bug, isn't it?
I'm using:
egcs-2.91.40 snapshot-19980608
regards, Haakon
--
Håkon Innerdal, Programmer, FunCom Oslo AS,
<hakoni@funcom.com>