audit: fix check for depending on requirement classes

Don't complain if it's instantiating the class so that it can pass
arguments.

Fixes #18883.