[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread drinob at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 --- Comment #6 from drinob at gmail dot com 2012-04-13 17:43:44 UTC --- Thank you for your explanation. Now it's all clear.

[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 --- Comment #5 from Jonathan Wakely 2012-04-13 17:27:33 UTC --- The standard says "Member functions can be called from a constructor (or destructor) of an abstract class; the effect of making a virtual call to a pure virtual function directly or

[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread drinob at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 --- Comment #4 from drinob at gmail dot com 2012-04-13 16:35:35 UTC --- But it seems to work in g++ 4.3 (which is used at ideone.com): http://ideone.com/zy5R4 Is that behavior uncorrect?

[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread drinob at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 --- Comment #3 from drinob at gmail dot com 2012-04-13 16:28:36 UTC --- Yes, this is my mistake.

[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|

[Bug c++/52972] Pure virtual method is called instead of child's method

2012-04-13 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52972 --- Comment #1 from Andrew Pinski 2012-04-13 16:24:07 UTC --- I think you are getting the correct behavior as the vtable for the base class is the current vtable for this. And "return static_cast < Real* > (this);" Does not change the v