Or the author could have added 'virtual' to the method declaration and discussed why that code now crashes due to a NULL dereference...
To put it another way, such an optimizer would transform incorrect programs into correct programs.
If you write correct programs, the optimization is useless since it only transforms incorrect programs. If you write incorrect programs, the optimization is dangerous since it makes it harder for you to figure out that your program is wrong.
Yeah. In retrospect my point doesn't really make any sense at all. Not sure what I was thinking there.