This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40997] Wrong address returned in covariant return
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2009 12:01:30 -0000
- Subject: [Bug c++/40997] Wrong address returned in covariant return
- References: <bug-40997-3398@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-08-07 12:01 -------
What is the expected output and what is the wrong output you see?
The Intel compiler produces
BaseIf@0x7fffffffdd88
Bar@0x7fffffffdd98
bart: 0x7fffffffdd88
baseIf: 0x7fffffffdd88
bar: 0x7fffffffdd98
baseIf2:0x7fffffffdd88
bart.getBaseVal(): 4711
baseIf.getBaseVal(): 4711
bar.getBaseVal(): 4711
baseIf2.getBaseVal():4711
outer:0x7fffffffdd88
bar: 0x7fffffffdd88
t: t.C:70: int Bar::InnerBar::getVal(): Assertion `&bar == Bar::instance'
failed.
Aborted
so I'm not sure your expectations are valid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40997