diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 01:21:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 01:21:13 +0000 |
commit | a2a299e586bf3143480e1a75fbe20235d5fa33ff (patch) | |
tree | 72d68885a853be9cce40546864b889e8dc1799c8 /clang/lib/Sema/SemaOverload.cpp | |
parent | 34ddc8db22b0faef3050fe41e502d1fea6bee062 (diff) | |
download | bcm5719-llvm-a2a299e586bf3143480e1a75fbe20235d5fa33ff.tar.gz bcm5719-llvm-a2a299e586bf3143480e1a75fbe20235d5fa33ff.zip |
[libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
that is referencing the member function, so we can index the referenced function.
Fixes rdar://10762375&10324915 & http://llvm.org/PR11192
llvm-svn: 150033
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index b0b2a783209..54dd5f86527 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -9585,7 +9585,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn, // Build the actual expression node. ExprResult FnExpr = CreateFunctionRefExpr(*this, FnDecl, - HadMultipleCandidates); + HadMultipleCandidates, OpLoc); if (FnExpr.isInvalid()) return ExprError(); @@ -10011,12 +10011,12 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, ResultTy = ResultTy.getNonLValueExprType(Context); // Build the actual expression node. - DeclarationNameLoc LocInfo; - LocInfo.CXXOperatorName.BeginOpNameLoc = LLoc.getRawEncoding(); - LocInfo.CXXOperatorName.EndOpNameLoc = RLoc.getRawEncoding(); + DeclarationNameInfo OpLocInfo(OpName, LLoc); + OpLocInfo.setCXXOperatorNameRange(SourceRange(LLoc, RLoc)); ExprResult FnExpr = CreateFunctionRefExpr(*this, FnDecl, HadMultipleCandidates, - LLoc, LocInfo); + OpLocInfo.getLoc(), + OpLocInfo.getInfo()); if (FnExpr.isInvalid()) return ExprError(); @@ -10521,8 +10521,13 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj, for (unsigned ArgIdx = 0; ArgIdx < NumArgs; ++ArgIdx) MethodArgs[ArgIdx + 1] = Args[ArgIdx]; + DeclarationNameInfo OpLocInfo( + Context.DeclarationNames.getCXXOperatorName(OO_Call), LParenLoc); + OpLocInfo.setCXXOperatorNameRange(SourceRange(LParenLoc, RParenLoc)); ExprResult NewFn = CreateFunctionRefExpr(*this, Method, - HadMultipleCandidates); + HadMultipleCandidates, + OpLocInfo.getLoc(), + OpLocInfo.getInfo()); if (NewFn.isInvalid()) return true; @@ -10698,7 +10703,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc) { // Build the operator call. ExprResult FnExpr = CreateFunctionRefExpr(*this, Method, - HadMultipleCandidates); + HadMultipleCandidates, OpLoc); if (FnExpr.isInvalid()) return ExprError(); |