public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4240: overloaded virtual functions getting lost in class hierarchy
@ 2001-09-09 14:18 aoliva
0 siblings, 0 replies; 2+ messages in thread
From: aoliva @ 2001-09-09 14:18 UTC (permalink / raw)
To: J.D.Lamb, gcc-bugs, gcc-prs, nobody
Synopsis: overloaded virtual functions getting lost in class hierarchy
State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Sun Sep 9 14:18:20 2001
State-Changed-Why:
Welcome to C++. The name defined in the derived class hides all overloads in the base class.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4240&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/4240: overloaded virtual functions getting lost in class hierarchy
@ 2001-09-05 14:06 J.D.Lamb
0 siblings, 0 replies; 2+ messages in thread
From: J.D.Lamb @ 2001-09-05 14:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 4240
>Category: c++
>Synopsis: overloaded virtual functions getting lost in class hierarchy
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Sep 05 14:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: J D Lamb
>Release: 2.95.2 19991024 (release)
>Organization:
>Environment:
Linux 2.4.2 #2 i686 (SuSE 6.4)
>Description:
A function in class A has overloaded virtual and non-virtual versions.
The virtual version is redefined in public subclass B.
The non-virtual function is not found in subclass C of B.
There is an easy workaround: don't overload function name.
Error message:
no matching function for call to `C::get_a (B &)'
candidates are: int B::get_a()
>How-To-Repeat:
>Fix:
Change name of one of the functions.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test4.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test4.cc"
Y2xhc3MgQSB7CnB1YmxpYzoKICBBKCBpbnQgYSApIDogYSggYSApIHt9CnByb3RlY3RlZDoKICB2
aXJ0dWFsIGludCBnZXRfYSgpIHsgcmV0dXJuIGE7IH0KICBzdGF0aWMgaW50IGdldF9hKCBBJiBh
ICkgeyBhLmdldF9hKCk7IH07CnByaXZhdGU6CiAgaW50IGE7Cn07CgpjbGFzcyBCIDogcHVibGlj
IEEgewogcHVibGljOgogIGludCBnZXRfYSgpIHsgcmV0dXJuIDA7IH0KICBCKCBpbnQgYSApIDog
QSAoIGEgKSB7fQp9OwoKY2xhc3MgQyA6IHB1YmxpYyBCIHsKcHVibGljOgogIEMoIGludCBhICkg
OiBCKCAwICksIGIoIGEgKSB7fQogIGludCBnZXRfdmFsKCkgeyByZXR1cm4gZ2V0X2EoIGIgKTsg
fQpwcml2YXRlOgogIEIgYjsKfTsKCmludCBtYWluKCl7CiAgZXhpdCgwKTsKfQo=
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-09 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 14:18 c++/4240: overloaded virtual functions getting lost in class hierarchy aoliva
-- strict thread matches above, loose matches on Subject: below --
2001-09-05 14:06 J.D.Lamb
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).