Clang used to error out on the following test case because we were forming a deduced-to-undeduced AutoType, which CheckNonTypeTemplateParameterType can't handle.
template <auto V> struct G {}; template <class T> struct S { template <auto V> void f() { G<V> x; // (incorrect) error while checking template parameter types } };
The problem here was that CurrentInstantiationRebuilder TreeTransform'd the auto template parameter type of G, which strips away the type-dependent bit (see TreeTransform::RebuildAutoType) which was previously set by CheckNonTypeTemplateParameterType. This patch recovers this information by substituting in the dependent type again. This is a very similar fix to r290660.
rdar://41852459
Thanks for taking a look!
Erik