This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18044] New: method signatures with argument overloading does not work across class boundaries
- From: "oyvind dot harboe at zylin dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2004 10:35:29 -0000
- Subject: [Bug c++/18044] New: method signatures with argument overloading does not work across class boundaries
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This does not compile:
class Foo
{
public:
void test(char *x)
{
}
};
class Bar : public Foo
{
public:
void test(double t)
{
test("x");
}
};
$ g++ -c test2.cc
test2.cc: In member function `void Bar::test(double)':
test2.cc:14: error: no matching function for call to `Bar::test(const char[2])'
test2.cc:13: error: candidates are: void Bar::test(double)
To make it compile, change to:
class Foo
{
public:
void testy(char *x)
{
}
};
class Bar : public Foo
{
public:
void test(double t)
{
testy("x");
}
};
--
Summary: method signatures with argument overloading does not
work across class boundaries
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: oyvind dot harboe at zylin dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18044