Mark compatibility shims as deprecated.

Fixes #2845
Merge branch 'master' into 2.5