diff options
| author | John McCall <rjmccall@apple.com> | 2010-01-28 01:42:12 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-01-28 01:42:12 +0000 |
| commit | b3a44005549256475f21986fc39e884530e1942c (patch) | |
| tree | 2d49b81e69573a0ef76354f73351c0d0b636ff5f /clang/lib/Sema/SemaOverload.cpp | |
| parent | 81310810bd67e15bcaa977f3dc58c4696cc5b56e (diff) | |
| download | bcm5719-llvm-b3a44005549256475f21986fc39e884530e1942c.tar.gz bcm5719-llvm-b3a44005549256475f21986fc39e884530e1942c.zip | |
Access checking for overloaded operators.
llvm-svn: 94725
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 2d48674228f..5506eeb4b2d 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -5515,10 +5515,10 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn, // We matched an overloaded operator. Build a call to that // operator. - // FIXME: access control - // Convert the arguments. if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FnDecl)) { + CheckMemberOperatorAccess(OpLoc, Args[0], Method, Best->getAccess()); + if (PerformObjectArgumentInitialization(Input, Method)) return ExprError(); } else { @@ -5698,10 +5698,11 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc, // We matched an overloaded operator. Build a call to that // operator. - // FIXME: access control - // Convert the arguments. if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FnDecl)) { + // Best->Access is only meaningful for class members. + CheckMemberOperatorAccess(OpLoc, Args[0], Method, Best->getAccess()); + OwningExprResult Arg1 = PerformCopyInitialization( InitializedEntity::InitializeParameter( @@ -5873,7 +5874,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, // We matched an overloaded operator. Build a call to that // operator. - // FIXME: access control + CheckMemberOperatorAccess(LLoc, Args[0], FnDecl, Best->getAccess()); // Convert the arguments. CXXMethodDecl *Method = cast<CXXMethodDecl>(FnDecl); |

