This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug report
- From: "Shangwu Qi" <swqi at strongholdtech dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Tue, 21 May 2002 18:04:27 -0400
- Subject: bug report
Hi,
I am using gcc ver2.9.6. I think this is a bug of this release.
=========================================
class Base
{
public:
Base& operator<< (char* str);
Base& outStr(char* str);
};
class Derive : public Base
{
public:
Derive operator<< (int* i) {}
void f(char *str)
{
*this << str; // compiler error reported:
// no match for `Derive & << char *&'
outStr(str); // OK
Base::operator<<(str); // OK
operator<<(str); // compiler error reported:
// no match for call to `Derive::operator<< (char
*&)'
}
};
=========================================
The derived clase should be able to call any base class's functions
including operator functions without specifying the class name.
Thanks,
Shangwu