public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10600: method lookup does not work correctly in dervied classes with virtual methods
@ 2003-05-02  8:36 ctron
  0 siblings, 0 replies; 2+ messages in thread
From: ctron @ 2003-05-02  8:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10600
>Category:       c++
>Synopsis:       method lookup does not work correctly in dervied classes with virtual methods
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri May 02 08:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     ctron@dentrassi.de
>Release:        gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
>Organization:
>Environment:
REDHAT 9
>Description:
See the attachments. The section "Problem" should work but does not.
>How-To-Repeat:
compile section "Problem" of the attachment
>Fix:
Use the workaround of the section "Workaround" in the attachment
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="inh_1.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="inh_1.cc"

Ci8vIC0tLS0tLS0tLT4+Pj4+Pj4+Pj4+PiBQcm9ibGVtCgojaW5jbHVkZSA8aW9zdHJlYW0+Cgpj
bGFzcyBBIHsKcHVibGljOgogIHZpcnR1YWwgdm9pZCB0ZXN0ICggdm9pZCApID0gMDsKfTsKCmNs
YXNzIEIgOiBwdWJsaWMgQSB7CnB1YmxpYzoKICB2aXJ0dWFsIHZvaWQgdGVzdCAoIHZvaWQgKQog
IHsKICAgIHRlc3QgKCAxICk7CiAgfQogIHZpcnR1YWwgdm9pZCB0ZXN0ICggaW50IGkgKSA9IDA7
Cn07CgpjbGFzcyBDIDogcHVibGljIEIgewpwdWJsaWM6CiAgdmlydHVhbCB2b2lkIHRlc3QgKCBp
bnQgaSApCiAgewogICAgc3RkOjpjb3V0IDw8ICJpID0gIiA8PCBpIDw8IHN0ZDo6ZW5kbDsKICB9
Cn07CgppbnQgbWFpbiAoIGludCBhcmdjLCBjaGFyICogYXJndltdICkKewogIEMgYzsKICBjLnRl
c3QgKCk7Cn0KCi8vIC0tLS0tLS0tLT4+Pj4+Pj4+Pj4+PiBXb3JrYXJvdW5kCgoKI2luY2x1ZGUg
PGlvc3RyZWFtPgoKY2xhc3MgQSB7CnB1YmxpYzoKICB2aXJ0dWFsIHZvaWQgdGVzdCAoIHZvaWQg
KSA9IDA7Cn07CgpjbGFzcyBCIDogcHVibGljIEEgewpwdWJsaWM6CiAgdmlydHVhbCB2b2lkIHRl
c3QgKCB2b2lkICkKICB7CiAgICB0ZXN0XzEgKCAxICk7CiAgfQogIHZpcnR1YWwgdm9pZCB0ZXN0
XzEgKCBpbnQgaSApID0gMDsKfTsKCmNsYXNzIEMgOiBwdWJsaWMgQiB7CnB1YmxpYzoKICB2aXJ0
dWFsIHZvaWQgdGVzdF8xICggaW50IGkgKQogIHsKICAgIHN0ZDo6Y291dCA8PCAiaSA9ICIgPDwg
aSA8PCBzdGQ6OmVuZGw7CiAgfQp9OwoKaW50IG1haW4gKCBpbnQgYXJnYywgY2hhciAqIGFyZ3Zb
XSApCnsKICBDIGM7CiAgYy50ZXN0ICgpOwp9Cg==


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/10600: method lookup does not work correctly in dervied classes with virtual methods
@ 2003-05-02 10:29 giovannibajo
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo @ 2003-05-02 10:29 UTC (permalink / raw)
  To: ctron, gcc-bugs, gcc-prs, nobody

Synopsis: method lookup does not work correctly in dervied classes with virtual methods

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Fri May  2 10:29:01 2003
State-Changed-Why:
    Not a bug, this is how C++ works: a function in a derived
    class completely shadows function(s) in a base class with
    the same name. Here C::test(int) is shadowing B::test(),
    hence the compilation error. Another workaround would be
    to put "using B::test;" inside the definition of class C.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10600


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-02 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02  8:36 c++/10600: method lookup does not work correctly in dervied classes with virtual methods ctron
2003-05-02 10:29 giovannibajo

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).