Index: lib/Serialization/ASTReaderDecl.cpp =================================================================== --- lib/Serialization/ASTReaderDecl.cpp +++ lib/Serialization/ASTReaderDecl.cpp @@ -3000,6 +3000,8 @@ for (unsigned I = 0, N = FromTP->size(); I != N; ++I) { NamedDecl *FromParam = FromTP->getParam(N - I - 1); + if (FromParam->isParameterPack()) + continue; NamedDecl *ToParam = ToTP->getParam(N - I - 1); if (auto *FTTP = dyn_cast(FromParam)) { Index: test/PCH/cxx-variadic-templates-with-default-params.h =================================================================== --- test/PCH/cxx-variadic-templates-with-default-params.h +++ test/PCH/cxx-variadic-templates-with-default-params.h @@ -0,0 +1,8 @@ +// PR25271: Ensure that variadic template parameter defaults PCH roundtrip +template +class dummy; + +template +class dummy { + int field[T]; +}; Index: test/PCH/cxx-variadic-templates-with-default-params.cpp =================================================================== --- test/PCH/cxx-variadic-templates-with-default-params.cpp +++ test/PCH/cxx-variadic-templates-with-default-params.cpp @@ -0,0 +1,12 @@ +// Test this without pch. +// RUN: %clang_cc1 -std=c++11 -include %S/cxx-variadic-templates-with-default-params.h -fsyntax-only -verify %s + +// Test with pch. +// RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %S/cxx-variadic-templates-with-default-params.h +// RUN: %clang_cc1 -std=c++11 -include-pch %t -fsyntax-only -verify %s + +// expected-no-diagnostics +void f() { + dummy<> x; + (void)x; +}