SI-8954 Make @deprecated{Overriding,Inheritance} aware of @deprecated.

This makes sure that:
 - there is no warning for a `@deprecated` class inheriting a
   `@deprecatedInheritance` class
 - there is no warning for a `@deprecated` method or a method of a
   `@deprecated` class overriding a `@deprecatedOverriding` method

This should remove quite a few useless deprecation warnings from the
library.
Is `enclClass` the best/right way to achieve this here?