public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: J.D.Lamb@btinternet.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/4240: overloaded virtual functions getting lost in class hierarchy
Date: Wed, 05 Sep 2001 14:06:00 -0000	[thread overview]
Message-ID: <20010905205926.10111.qmail@sourceware.cygnus.com> (raw)

>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=


             reply	other threads:[~2001-09-05 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05 14:06 J.D.Lamb [this message]
2001-09-09 14:18 aoliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010905205926.10111.qmail@sourceware.cygnus.com \
    --to=j.d.lamb@btinternet.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).