diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-07-16 18:50:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-07-16 18:50:45 +0000 |
commit | 85f485a70fbec54c9b4562dfc4d95188ea6c9b48 (patch) | |
tree | ffe7d9cefa5fb10538b42b7db16221e4217526e6 | |
parent | daa872b64d2654f2e2b4ccb1697107640ffd38a8 (diff) |
Fix rejects-valid: explicit specialization of redeclared deleted function template.
Review by Richard Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160306 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/deleted-function.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 0d3e8a0ba8..a2efa597c2 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2423,7 +2423,7 @@ void Sema::InstantiateExceptionSpec(SourceLocation PointOfInstantiation, bool TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New, FunctionDecl *Tmpl) { - if (Tmpl->isDeletedAsWritten()) + if (Tmpl->isDeleted()) New->setDeletedAsWritten(); // If we are performing substituting explicitly-specified template arguments diff --git a/test/SemaCXX/deleted-function.cpp b/test/SemaCXX/deleted-function.cpp index 83764bafe8..e78e7edc71 100644 --- a/test/SemaCXX/deleted-function.cpp +++ b/test/SemaCXX/deleted-function.cpp @@ -59,10 +59,9 @@ DelDtor dd; // expected-error {{attempt to use a deleted function}} 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'}} |