public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43120]  New: Diamond virtual inheritence with covariant return type confuses GCC
@ 2010-02-19 14:22 goeran at uddeborg dot se
  2010-02-19 14:24 ` [Bug c++/43120] " goeran at uddeborg dot se
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: goeran at uddeborg dot se @ 2010-02-19 14:22 UTC (permalink / raw)
  To: gcc-bugs

Diamond shaped class structure with a covariant return method causes GCC to
fail to adjust base pointers.  In the attached program, the output is a huge
number instead of the expected 123.

Looking at what happens in GDB, it appears that the this pointer in the call of
A(const A &other) gets a B reference rather than an A reference.  The place
where it expects to find the member A::a is actually outside of the object of
type F.  If I'm reading the output from GDB correctly.


-- 
           Summary: Diamond virtual inheritence with covariant return type
                    confuses GCC
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: goeran at uddeborg dot se


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43120


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

end of thread, other threads:[~2010-07-09 20:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-19 14:22 [Bug c++/43120] New: Diamond virtual inheritence with covariant return type confuses GCC goeran at uddeborg dot se
2010-02-19 14:24 ` [Bug c++/43120] " goeran at uddeborg dot se
2010-02-19 14:39 ` rguenth at gcc dot gnu dot org
2010-02-23  1:45 ` jason at gcc dot gnu dot org
2010-02-24 11:03 ` goeran at uddeborg dot se
2010-07-01 19:57 ` [Bug c++/43120] Virtual " jason at gcc dot gnu dot org
2010-07-02 21:13 ` jason at gcc dot gnu dot org
2010-07-05 10:56 ` nathan at codesourcery dot com
2010-07-07 13:24 ` jason at gcc dot gnu dot org
2010-07-07 13:56 ` nathan at gcc dot gnu dot org
2010-07-08 14:01 ` [Bug c++/43120] Virtual inheritance " jason at gcc dot gnu dot org
2010-07-09 19:36 ` jason at gcc dot gnu dot org
2010-07-09 19:41 ` jason at gcc dot gnu dot org
2010-07-09 19:46 ` jason at gcc dot gnu dot org
2010-07-09 19:50 ` jason at gcc dot gnu dot org
2010-07-09 20:12 ` jason at gcc dot gnu dot org

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