forked from OSchip/llvm-project
Add missing check for error return from DefaultLvalueConversion. Fixes <rdar://problem/12857416>.
llvm-svn: 170056
This commit is contained in:
parent
caaf4dd516
commit
89a4a2cd3d
|
@ -2026,6 +2026,8 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
|
|||
if (!Ex.get()->isTypeDependent()) {
|
||||
// Perform lvalue-to-rvalue cast, if needed.
|
||||
Ex = DefaultLvalueConversion(Ex.take());
|
||||
if (Ex.isInvalid())
|
||||
return ExprError();
|
||||
|
||||
QualType Type = Ex.get()->getType();
|
||||
|
||||
|
|
|
@ -499,3 +499,14 @@ namespace PR12061 {
|
|||
DeferredCookieTaskTest() {}
|
||||
};
|
||||
}
|
||||
|
||||
class DeletingPlaceholder {
|
||||
int* f() {
|
||||
delete f; // expected-error {{reference to non-static member function must be called; did you mean to call it with no arguments?}}
|
||||
return 0;
|
||||
}
|
||||
int* g(int, int) {
|
||||
delete g; // expected-error {{reference to non-static member function must be called}}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue