During the initial template parse for this code, 'member' is unresolved
and we don't know anything about it:
struct A { int member };
template <typename T>
struct B : public T {
using T::member;
static void f() {
(void)member; // Could be static or non-static.
}
};
template class B<A>;The pattern declaration contains an UnresolvedLookupExpr rather than an
UnresolvedMemberExpr because f is static, and member should never
be a field. However, if the code is invalid, it may become a field, in which
case we need to attempt to form a member expr so that we get a diagnostic.
Please also add a test for the case with explicit template arguments, something like:
struct X { template<typename> void f(); template<typename T, typename T::type = 0> static void f(); template<typename T> void g() { (void)f<T>; } }; void h(X x) { x.g<int>(); }... should do the trick. (This already seems to work.)