Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -2912,7 +2912,7 @@ // Fill in the trailing argument array. auto *argSlot = getTrailingObjects(); for (unsigned i = 0; i != getNumParams(); ++i) { - if (params[i]->isDependentType()) + if (params[i]->isDependentType() || params[i]->getAs()) setDependent(); else if (params[i]->isInstantiationDependentType()) setInstantiationDependent(); Index: clang/test/SemaTemplate/alias-templates.cpp =================================================================== --- clang/test/SemaTemplate/alias-templates.cpp +++ clang/test/SemaTemplate/alias-templates.cpp @@ -267,3 +267,34 @@ int z = Bar(); // expected-error {{use of template template parameter 'Bar' requires template arguments}} } } + +namespace PR42654 { + template struct function { }; + + template + struct thing { + void f(function) { } + }; + + template + struct Environment + { + template + using Integer = int; + + using Function = function...)>; + using MyTuple = thing...>; + + void run(Function func) + { + MyTuple t; + t.f(func); + } + }; + + void f() + { + Environment env; + env.run({}); + } +}