Index: lib/Sema/TreeTransform.h =================================================================== --- lib/Sema/TreeTransform.h +++ lib/Sema/TreeTransform.h @@ -3311,8 +3311,6 @@ if (Out.isInvalid()) return true; - // FIXME: Can this happen? We should not try to expand the pack - // in this case. if (Out.get()->containsUnexpandedParameterPack()) { Out = getDerived().RebuildPackExpansion( Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions); @@ -4781,6 +4779,13 @@ if (NewType.isNull()) return true; + if (NewType->containsUnexpandedParameterPack()) { + NewType = getDerived().RebuildPackExpansionType( + NewType, SourceRange(), Loc, NumExpansions); + if (NewType.isNull()) + return true; + } + if (ParamInfos) PInfos.set(OutParamTypes.size(), ParamInfos[i]); OutParamTypes.push_back(NewType); Index: test/CXX/temp/temp.decls/temp.variadic/p5.cpp =================================================================== --- test/CXX/temp/temp.decls/temp.variadic/p5.cpp +++ test/CXX/temp/temp.decls/temp.variadic/p5.cpp @@ -437,3 +437,32 @@ template void g<>(); template void g<1, 2, 3>(); } + +template +int var_expr(Ts... ts); + +template +auto a_function(Ts... ts) -> decltype(var_expr(ts...)); + +template +using partial = decltype(a_function); + +int use_partial() { partial n; } + +namespace PR26017 { +template +struct Foo {}; +template +using FooAlias = Foo; + +template +void bar(const FooAlias &) {} + +int fn() { + FooAlias<> a; + bar(a); + + FooAlias b; + bar(b); +} +}