public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10509: Problems w/ casting to base classes of classes with multiple inheritance
@ 2003-04-28 14:13 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-04-28 14:13 UTC (permalink / raw)
  To: bero, gcc-bugs, gcc-prs, nobody

Synopsis: Problems w/ casting to base classes of classes with multiple inheritance

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr 28 14:13:27 2003
State-Changed-Why:
    Not a bug. You can't cast between parallel classes using
    C-style casts. Use
        C *c=dynamic_cast<C*>(a);
    instead and it works as you expect it to do.
    
    W.

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


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

* c++/10509: Problems w/ casting to base classes of classes with multiple inheritance
@ 2003-04-26 19:16 bero
  0 siblings, 0 replies; 2+ messages in thread
From: bero @ 2003-04-26 19:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10509
>Category:       c++
>Synopsis:       Problems w/ casting to base classes of classes with multiple inheritance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 26 19:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     bero@arklinux.org
>Release:        gcc-3_3-branch as of 2003/04/26
>Organization:
>Environment:
Linux 2.4.21rc1, glibc 2.3.2
>Description:
The attached code outputs "bbb" instead of the expected "bbc". (c->foo() should return "c")
>How-To-Repeat:
Compile and run the attached code
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="gccbug.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gccbug.cxx"

I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQQp7CnB1Ymxp
YzoKCXZpcnR1YWwgc3RyaW5nIHRlc3QoKSB7IHJldHVybiAiYSI7IH0KfTsKCmNsYXNzIEI6cHVi
bGljIEEKewpwdWJsaWM6Cgl2aXJ0dWFsIHN0cmluZyB0ZXN0KCkgeyByZXR1cm4gImIiOyB9Cn07
CgpjbGFzcyBDCnsKcHVibGljOgoJdmlydHVhbCBzdHJpbmcgZm9vKCkgeyBjZXJyIDw8ICJyZXR1
cm5pbmcgYyIgPDwgZW5kbDsgcmV0dXJuICJjIjsgfQp9OwoKY2xhc3MgRDpwdWJsaWMgQixDCnsK
fTsKCQkKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQp7CglEICpkPW5ldyBEKCk7Cglj
ZXJyIDw8IGQtPnRlc3QoKSA8PCBkLT5mb28oKSA8PCBlbmRsOwoJQSAqYT0oQSopbmV3IEQoKTsK
CUIgKmI9KEIqKWE7CglDICpjPShDKilhOwoJY2VyciA8PCBhLT50ZXN0KCkgPDwgYi0+dGVzdCgp
IDw8IGMtPmZvbygpIDw8IGVuZGw7Cn0K


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

end of thread, other threads:[~2003-04-28 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28 14:13 c++/10509: Problems w/ casting to base classes of classes with multiple inheritance bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-26 19:16 bero

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