Artur Skawina:
The gain from such checks would be minimal. Eg "return x.toray;".
I think we have no statistics about how much gain that's going to give.
And even small improvement are good to have, if they are automatic (done by the compiler instead of the programmer), and if they have no false positives.
Once such checks are in place, it will be possible to add better checks and further improvements :-) So I think ER 9715 is a good idea.
Bye, bearophile