Index: cfe/trunk/lib/Sema/TreeTransform.h =================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h +++ cfe/trunk/lib/Sema/TreeTransform.h @@ -3327,8 +3327,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); @@ -4822,6 +4820,14 @@ if (NewType.isNull()) return true; + if (NewType->containsUnexpandedParameterPack()) { + NewType = + getSema().getASTContext().getPackExpansionType(NewType, None); + + if (NewType.isNull()) + return true; + } + if (ParamInfos) PInfos.set(OutParamTypes.size(), ParamInfos[i]); OutParamTypes.push_back(NewType); Index: cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p5.cpp =================================================================== --- cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p5.cpp +++ cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p5.cpp @@ -437,3 +437,35 @@ 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 +using FooAliasAlias = FooAlias; + +template +void bar(const FooAlias &) {} + +int fn() { + FooAlias<> a; + bar(a); + + FooAlias b; + bar(b); +} +}