Index: lib/Sema/TreeTransform.h =================================================================== --- lib/Sema/TreeTransform.h +++ lib/Sema/TreeTransform.h @@ -3583,7 +3583,7 @@ case TemplateArgument::Template: case TemplateArgument::TemplateExpansion: { NestedNameSpecifierLocBuilder Builder; - TemplateName Template = Arg.getAsTemplate(); + TemplateName Template = Arg.getAsTemplateOrTemplatePattern(); if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) Builder.MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc); else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) Index: test/SemaTemplate/temp_arg_template.cpp =================================================================== --- test/SemaTemplate/temp_arg_template.cpp +++ test/SemaTemplate/temp_arg_template.cpp @@ -75,7 +75,11 @@ // expected-warning@-2 {{variadic templates are a C++11 extension}} #endif -struct template_tuple {}; +struct template_tuple { +#if __cplusplus >= 201103L + static constexpr int N = sizeof...(Templates); +#endif +}; template struct identity {}; template