Fixes: PR28290
When checking an argument list, arguments from the templated class instance, were
returning 'is dependent' based on the 'this' pointer. In that case, arguments were
being marked dependent, and name lookup was delayed until template instantiation. This
had the side-effect of -fdelayed-template-parsing in certain cases
(attached test case), when that should not have been the case, especially
since that flag was never passed.
According to the standard the referenced member's type needs
to be checked:
[temp.dep.expr]p5:
A class member access expression (5.2.5) is type-dependent if the expression
refers to a member of the current instantiation and the type of the referenced
member is dependent, or the class member access expression refers to a member
of an unknown specialization.
This change decides if the argument belongs to a MemberExpr. If so, then the
type of the expression is checked if it is dependent or not.