Access control, availability and exportability checking missed these
because of a baked-in assumption that getGenericParams() == nullptr
rules out the presence of a trailing where clause.
Previously, the protocol refinement access control error
would always assume a protocol was being refined. Change it
to instead refer to the appropriate declaration kind.
Resolves SR-9195
We weren't checking this before, which would let you define a
public protocol that no public type could conform to.
This is a source-breaking change, so stage it in with a warning.
It becomes an error in -swift-version 5 mode.