forked from OSchip/llvm-project
Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete
llvm-svn: 151442
This commit is contained in:
parent
561fb15801
commit
978cc7306c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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}}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue