Author: dblaikie Date: Mon Jul 16 13:50:45 2012 New Revision: 160306 URL: http://llvm.org/viewvc/llvm-project?rev=160306&view=rev Log: Fix rejects-valid: explicit specialization of redeclared deleted function template.
Review by Richard Smith. Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp cfe/trunk/test/SemaCXX/deleted-function.cpp Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=160306&r1=160305&r2=160306&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Mon Jul 16 13:50:45 2012 @@ -2423,7 +2423,7 @@ bool TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New, FunctionDecl *Tmpl) { - if (Tmpl->isDeletedAsWritten()) + if (Tmpl->isDeleted()) New->setDeletedAsWritten(); // If we are performing substituting explicitly-specified template arguments Modified: cfe/trunk/test/SemaCXX/deleted-function.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/deleted-function.cpp?rev=160306&r1=160305&r2=160306&view=diff ============================================================================== --- cfe/trunk/test/SemaCXX/deleted-function.cpp (original) +++ cfe/trunk/test/SemaCXX/deleted-function.cpp Mon Jul 16 13:50:45 2012 @@ -59,10 +59,9 @@ template<typename> void test2() = delete; template void test2<int>(); -// test3 really shouldn't have behavior that differs from test2 above -template<typename> void test3() = delete; // expected-note {{explicit instantiation refers here}} +template<typename> void test3() = delete; template<typename> void test3(); -template void test3<int>(); // expected-error {{explicit instantiation of undefined function template 'test3'}} +template void test3<int>(); void test4() {} // expected-note {{previous definition is here}} void test4() = delete; // expected-error {{redefinition of 'test4'}} _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits