Author: rsmith Date: Thu Aug 20 15:45:25 2015 New Revision: 245609 URL: http://llvm.org/viewvc/llvm-project?rev=245609&view=rev Log: PR24483: Delete some dead/incorrect code that triggered assertions.
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp cfe/trunk/test/SemaTemplate/instantiate-var-template.cpp Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=245609&r1=245608&r2=245609&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaTemplate.cpp (original) +++ cfe/trunk/lib/Sema/SemaTemplate.cpp Thu Aug 20 15:45:25 2015 @@ -2469,25 +2469,6 @@ DeclResult Sema::ActOnVarTemplateSpecial false, Converted)) return true; - // Check that the type of this variable template specialization - // matches the expected type. - TypeSourceInfo *ExpectedDI; - { - // Do substitution on the type of the declaration - TemplateArgumentList TemplateArgList(TemplateArgumentList::OnStack, - Converted.data(), Converted.size()); - InstantiatingTemplate Inst(*this, TemplateKWLoc, VarTemplate); - if (Inst.isInvalid()) - return true; - VarDecl *Templated = VarTemplate->getTemplatedDecl(); - ExpectedDI = - SubstType(Templated->getTypeSourceInfo(), - MultiLevelTemplateArgumentList(TemplateArgList), - Templated->getTypeSpecStartLoc(), Templated->getDeclName()); - } - if (!ExpectedDI) - return true; - // Find the variable template (partial) specialization declaration that // corresponds to these arguments. if (IsPartialSpecialization) { Modified: cfe/trunk/test/SemaTemplate/instantiate-var-template.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-var-template.cpp?rev=245609&r1=245608&r2=245609&view=diff ============================================================================== --- cfe/trunk/test/SemaTemplate/instantiate-var-template.cpp (original) +++ cfe/trunk/test/SemaTemplate/instantiate-var-template.cpp Thu Aug 20 15:45:25 2015 @@ -34,3 +34,9 @@ namespace InstantiationDependent { static_assert(a<sizeof(sizeof(f(T())))> == 0, ""); // expected-error {{static_assert failed}} } } + +namespace PR24483 { + template<typename> struct A; + template<typename... T> A<T...> models; + template<> struct B models<>; // expected-error {{incomplete type 'struct B'}} expected-note {{forward declaration}} +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits