Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -3418,7 +3418,9 @@ InstantiationDependent)) { Diag(TemplateNameLoc, diag::err_partial_spec_fully_specialized) << VarTemplate->getDeclName(); - IsPartialSpecialization = false; + // FIXME: Can this ever get triggered? If so, we need test. If not, + // should this if be removed? + return true; } if (isSameAsPrimaryTemplate(VarTemplate->getTemplateParameters(), @@ -7276,7 +7278,7 @@ TemplateArgs.arguments(), InstantiationDependent)) { Diag(TemplateNameLoc, diag::err_partial_spec_fully_specialized) << ClassTemplate->getDeclName(); - isPartialSpecialization = false; + return true; } } Index: test/SemaTemplate/partial-spec-fully-specified.cpp =================================================================== --- /dev/null +++ test/SemaTemplate/partial-spec-fully-specified.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s + +template +struct Base{}; + +template +class Test {}; + +template +class Test : Base { // expected-error{{partial specialization of 'Test' does not use any of its template parameters}} + Test() {} +};