Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -2542,7 +2542,7 @@ InstantiationDependent)) { Diag(TemplateNameLoc, diag::err_partial_spec_fully_specialized) << VarTemplate->getDeclName(); - IsPartialSpecialization = false; + return true; } if (isSameAsPrimaryTemplate(VarTemplate->getTemplateParameters(), @@ -6286,7 +6286,7 @@ InstantiationDependent)) { Diag(TemplateNameLoc, diag::err_partial_spec_fully_specialized) << ClassTemplate->getDeclName(); - isPartialSpecialization = false; + return true; } } Index: test/SemaCXX/pr26077-crash-on-invalid.cpp =================================================================== --- /dev/null +++ test/SemaCXX/pr26077-crash-on-invalid.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// Don't crash (PR26077). + +class DB {}; + +template class RemovePolicy : public T {}; + +template > + class Crash : T, Policy {}; + +template +class Crash : public DB, public Policy { // expected-error {{partial specialization of 'Crash' does not use any of its template parameters}} +public: + Crash(){} +};