public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5575: Inheritance of overloaded methods fail.
@ 2002-02-01 14:06 sawinski
0 siblings, 0 replies; 2+ messages in thread
From: sawinski @ 2002-02-01 14:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 5575
>Category: c++
>Synopsis: Inheritance of overloaded methods fail.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 01 14:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: sawinski@web.de
>Release: gcc-3.0.3
>Organization:
>Environment:
Linux nc1701d 2.4.18-pre7-ac1 #2 Tue Jan 29 22:21:52 CET 2002 i686 unknown
>Description:
If class A defines a couple of overloaded methods (virtual or not), and one inherits this class in another class, let's say B, that redefines one of these methods, the other overloaded methods from A are not accessible anymore without prepending "A::".
>How-To-Repeat:
#include <iostream>
using namespace std;
class A
{
public:
void f();
void f(int);
};
void A::f() { cout << "A::f()" << endl; }
void A::f(int) { cout << "A::f(int)" << endl; }
class B : public A
{
public:
void f(int);
};
void B::f(int) { cout << "B::f(int)" << endl; }
int
main(int argc, const char **argv)
{
A a;
B b;
b.f(); // <-- compilation fails here: no matching function for call to `B::f()
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/5575: Inheritance of overloaded methods fail.
@ 2002-02-02 3:06 nathan
0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-02-02 3:06 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, sawinski
Synopsis: Inheritance of overloaded methods fail.
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Sat Feb 2 03:06:38 2002
State-Changed-Why:
not a bug. this is the correct behaviour. you need
a using declaration to do what you want
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5575
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-02-02 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 14:06 c++/5575: Inheritance of overloaded methods fail sawinski
2002-02-02 3:06 nathan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).