[Debug] track and report deprecated classes and interfaces
feature #13164 [Debug] track and report deprecated classes and interfaces (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] track and report deprecated classes and interfaces

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

a541faf [Debug] track and report deprecated classes and interfaces