Alexander Tumarov wrote in news:3ca86be5.0405010219.4ceceb05
@posting.google.com in comp.lang.c++:
>
> The question is why compiler builds call to both
> B& operator=(const B &b)
> C& operator=(const C &c)
>
> on the line
> d1=d2;
> ???
>
> A much as I remember on the case of missing copy operator the compiler
> should build default one that performs bit-to-bit copy and not call base
> copy operators. Am I wrong?
Yes you're wrong, the compiler generated D:

perator=(D const &) does
member (and basewise) assignment using the members/bases (possibly
compiler generated) operator=. The compiler never does bit-to-bit
copying of a UDT, except perhaps under the as-if rule, when all
members are builtins and use (or can use) bit-to-bit copying.
Rob.
--
http://www.victim-prime.dsl.pipex.com/