I do not know if there are some build bots with -Werror that would warn for unknown attributes. In case it fails the build bots we could extend the include/llvm/Support/Compiler.h header with a macro.
Generally, ArrayRef is also a candidate. But there we have the complication that OwningArrayRef indirectly inherits from ArrayRef. One is a gsl::Owner, the other a gsl::Pointer, and we
need to make sure that we handle it correctly when OwningArrayRef is accessed through its base class which is then seen as a Pointer.
I would thus defer this part to a later PR.
This revision leads to a pervasive warning from StringRef.h (on the release build with Clang/Clang++ 9.0.1):
llvm/include/llvm/ADT/StringRef.h:57:11: warning: unknown attribute 'Pointer' ignored [-Wunknown-attributes]
builds with compilers which don't implement this attribute are basically useless. This should either be predicated on the compiler supporting this attribute, or -W(unknown-)attributes should be disabled in cmake.