Objective-C type encodings are normally pretty small but they it is
pretty easy for them to bloat to undesirable levels. Bloated Objective-C
type encodings are particularly common for Objective-C methods with
templated C++ types in their interface in Objective-C++. For example,
in Objective-C type encodings std::string expands to 277 bytes and
std::map<std::string, std::string> expands to 1219 bytes. The bloat
isn't particularly important for larger binaries but SDKs sometimes
optimize their binary size to ease adoption. This check aims to provide
some level of visibility into the size of generated Objective-C type
encodings so that developers can address them if they want.
Related article:
https://medium.com/@dmaclach/objective-c-encoding-and-you-866624cc02de
Test Notes:
Verified clang-tidy tests pass successfully.
hasAncestor is an expensive matcher, does hasDeclContext meet your use cases?