This patch fixes a regression introduced in r359947. Here:
template <class T2> struct Outer { template <class T1> static constexpr auto x = 1; }; int main() { Outer<int> x; int i = x.x<int>; }
We'd defer the instantiation of the initializer of the variable template when instantiating Outer<int> (leaving the variable template with an undeduced type). We do eventually instantiate the initializer and deduce the type of the variable when we're marking Outer<int>::x<int> referenced, but not before forming a MemberExpr that refers to the undeduced type. I think we could avoid instantiating the initializer of the variable template here, but that doesn't appear to be the intent of r359947, so this patch just falls back to the 8.0 behaviour.
Fixes rdar://52619644
Thanks for taking a look!
Erik