forked from OSchip/llvm-project
Avoid redundant error when redefining a function as deleted.
Reviewed by Doug Gregor. llvm-svn: 159442
This commit is contained in:
parent
674acc12d0
commit
af031a9af7
|
@ -10318,8 +10318,8 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) {
|
|||
if (const FunctionDecl *Prev = Fn->getPreviousDecl()) {
|
||||
// Don't consider the implicit declaration we generate for explicit
|
||||
// specializations. FIXME: Do not generate these implicit declarations.
|
||||
if (Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization
|
||||
|| Prev->getPreviousDecl()) {
|
||||
if ((Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization
|
||||
|| Prev->getPreviousDecl()) && !Prev->isDefined()) {
|
||||
Diag(DelLoc, diag::err_deleted_decl_not_first);
|
||||
Diag(Prev->getLocation(), diag::note_previous_declaration);
|
||||
}
|
||||
|
|
|
@ -63,3 +63,6 @@ template void test2<int>();
|
|||
template<typename> void test3() = delete; // expected-note {{explicit instantiation refers here}}
|
||||
template<typename> void test3();
|
||||
template void test3<int>(); // expected-error {{explicit instantiation of undefined function template 'test3'}}
|
||||
|
||||
void test4() {} // expected-note {{previous definition is here}}
|
||||
void test4() = delete; // expected-error {{redefinition of 'test4'}}
|
||||
|
|
Loading…
Reference in New Issue