diff options
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 51916b63324..72c069f7dae 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1666,9 +1666,13 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range, Args[i] = Result.takeAs<Expr>(); } + Operator = FnDecl; - CheckAllocationAccess(StartLoc, Range, R.getNamingClass(), Best->FoundDecl, - Diagnose); + + if (CheckAllocationAccess(StartLoc, Range, R.getNamingClass(), + Best->FoundDecl, Diagnose) == AR_inaccessible) + return true; + return false; } @@ -1895,8 +1899,10 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, return true; } - CheckAllocationAccess(StartLoc, SourceRange(), Found.getNamingClass(), - Matches[0], Diagnose); + if (CheckAllocationAccess(StartLoc, SourceRange(), Found.getNamingClass(), + Matches[0], Diagnose) == AR_inaccessible) + return true; + return false; // We found multiple suitable operators; complain about the ambiguity. |