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 | 5a0956e98d354837d7cb7cb1039ac672c7a11ee6 (patch) | |
| tree | 471a842da18d6351d2f343ee7edc7d09cc57d27c | |
| parent | 839a06e9d751654fc5e5b2e0050735dd8dff39e5 (diff) | |
| download | bcm5719-llvm-5a0956e98d354837d7cb7cb1039ac672c7a11ee6.tar.gz bcm5719-llvm-5a0956e98d354837d7cb7cb1039ac672c7a11ee6.zip | |
Fix rejects-valid: explicit specialization of redeclared deleted function template.
Review by Richard Smith.
llvm-svn: 160306
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaCXX/deleted-function.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 0d3e8a0ba8e..a2efa597c22 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/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/clang/test/SemaCXX/deleted-function.cpp b/clang/test/SemaCXX/deleted-function.cpp index 83764bafe8f..e78e7edc719 100644 --- a/clang/test/SemaCXX/deleted-function.cpp +++ b/clang/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'}} |

