[Bug c++/33470] Reassignment of a reference to a polymorphic class fails at runtime

2007-09-18 Thread bangerth at dealii dot org
--- Comment #4 from bangerth at dealii dot org 2007-09-18 18:48 --- To be quite clear: you can re-associate references (unlike pointers), so when you do Ainst = Cinst, you copy the A-part of Cinst, but you still have a 'B' whose 'A' component has just been overwritten. W. -- http:/

[Bug c++/33470] Reassignment of a reference to a polymorphic class fails at runtime

2007-09-18 Thread photon at seznam dot cz
--- Comment #3 from photon at seznam dot cz 2007-09-18 15:12 --- (In reply to comment #1) > No, "B" is correct. > > > A &Aref = Binst; > Aref = Cinst; > > is the same as: > Binst = (A)Cinst; > The compiler treats this case as Ainst = (A) Cinst. -- photon at sezna

[Bug c++/33470] Reassignment of a reference to a polymorphic class fails at runtime

2007-09-18 Thread photon at seznam dot cz
--- Comment #2 from photon at seznam dot cz 2007-09-18 12:01 --- (In reply to comment #1) > No, "B" is correct. > > > A &Aref = Binst; > Aref = Cinst; > > is the same as: > Binst = (A)Cinst; > "Binst = (A)Cinst" would not compile (C is not derived from B). -- pho

[Bug c++/33470] Reassignment of a reference to a polymorphic class fails at runtime

2007-09-18 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-09-18 11:00 --- No, "B" is correct. A &Aref = Binst; Aref = Cinst; is the same as: Binst = (A)Cinst; -- pinskia at gcc dot gnu dot org changed: What|Removed |Added -