diff options
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 964334b20bb..0689c6cce96 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -851,8 +851,13 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, // Try to find operator delete/operator delete[] in class scope. LookupResult Found; LookupQualifiedName(Found, Record, DeleteName, LookupOrdinaryName); + + if (Found.isAmbiguous()) { + DiagnoseAmbiguousLookup(Found, DeleteName, StartLoc); + return ExprError(); + } + // FIXME: Diagnose ambiguity properly - assert(!Found.isAmbiguous() && "Ambiguous delete/delete[] not handled"); for (LookupResult::iterator F = Found.begin(), FEnd = Found.end(); F != FEnd; ++F) { if (CXXMethodDecl *Delete = dyn_cast<CXXMethodDecl>(*F)) |