Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete

llvm-svn: 151442
This commit is contained in:
Richard Smith 2012-02-25 09:42:26 +00:00
parent 561fb15801
commit 978cc7306c
2 changed files with 7 additions and 1 deletions

View File

@ -1881,7 +1881,8 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
if (Operator->isDeleted()) {
if (Diagnose) {
Diag(StartLoc, diag::err_deleted_function_use);
Diag(Operator->getLocation(), diag::note_unavailable_here) << true;
Diag(Operator->getLocation(), diag::note_unavailable_here)
<< /*function*/ 1 << /*deleted*/ 1;
}
return true;
}

View File

@ -11,3 +11,8 @@ int PR10757f() {
if(~a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 6 {{built-in candidate}}
if(a1==a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 81 {{built-in candidate}}
}
struct DelOpDel {
virtual ~DelOpDel() {} // expected-error {{deleted function}}
void operator delete(void*) = delete; // expected-note {{deleted here}}
};