Clang emits an incorrect -Wunused-lambda-capture for 'this' capture in a generic lambda in a template where 'this' is used implicitly in an unresolved member expression. This patch ensures that the use of 'this' is checked as a potential lambda capture use when the lambda is instantiated.
rdar://38803903
This doesn't make sense; in general, you can't tell whether an UnresolvedMemberExpr requires a "this" capture.
template<typename T> class C : T { static int f(int); int f(double); public: int g() { return []{ return f(T::x); }(); } }; struct A { static int x; }; void x(C<A> c) { c.g(); }