This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15580] wrong code generation in c++ assignment operator


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]