This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15580] wrong code generation in c++ assignment operator
- From: "unicorn at freeshell dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2004 00:38:59 -0000
- Subject: [Bug c++/15580] wrong code generation in c++ assignment operator
- References: <20040521234554.15580.unicorn@re.com.ua>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From unicorn at freeshell dot org 2004-05-22 00:38 -------
(In reply to comment #2)
> I cannot reproduce this at all on 3.3.3, 3.4.0 or 3.2.3.
3.2.x hasn't this bug.
(proposed patch was created after comparition of do_build_assign_ref
routines of 3.2.3 and 3.3.3)
I did't test this on 3.4, but I'm completely sure 3.3.3 has this bug.
It may not show because of optimization or someth else.
try this:
#include <iostream>
struct A {
const A &operator = (const A &r) {
std::cout << this << std::endl;
}
};
struct B : virtual A { };
struct C : virtual A { };
struct D : B, C { };
int
main()
{
D d0, d1;
d0 = d1;
}
On 3.2 this will produce two equal address (as it has to be for virtual
inheritance), but 3.3 will show a different one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15580