diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-01 23:18:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-01 23:18:25 +0000 |
commit | 6bc9768408d4b45e00350018b6e3540bc05d267d (patch) | |
tree | 398e9f5f468f660922b527b95e0ff5e363ef312c /lib/Sema/SemaExprCXX.cpp | |
parent | fbcc7bed1a0661ecc91b62e0696b8310887713f6 (diff) |
Fix a code gen. crash synthesizing a destructor.
Fixes pr5660.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 00fb65df92..e626aff38b 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -776,7 +776,8 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, DeclarationName Name, - FunctionDecl* &Operator) { + FunctionDecl* &Operator, + bool Diagnose) { LookupResult Found(*this, Name, StartLoc, LookupOrdinaryName); // Try to find operator delete/operator delete[] in class scope. LookupQualifiedName(Found, RD); @@ -796,6 +797,8 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, // We did find operator delete/operator delete[] declarations, but // none of them were suitable. if (!Found.empty()) { + if (!Diagnose) + return true; Diag(StartLoc, diag::err_no_suitable_delete_member_function_found) << Name << RD; |