summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index a6e1611dc31..a13bcbab629 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1295,12 +1295,16 @@ ActOnCallExpr(ExprTy *fn, SourceLocation LParenLoc,
}
if (Ovl) {
- Fn = ResolveOverloadedCallFn(Fn, Ovl, LParenLoc, Args, NumArgs, CommaLocs,
- RParenLoc);
- if (!Fn)
+ FDecl = ResolveOverloadedCallFn(Fn, Ovl, LParenLoc, Args, NumArgs, CommaLocs,
+ RParenLoc);
+ if (!FDecl)
return true;
- // Fall through and build the call to Fn.
+ // Update Fn to refer to the actual function selected.
+ Expr *NewFn = new DeclRefExpr(FDecl, FDecl->getType(),
+ Fn->getSourceRange().getBegin());
+ Fn->Destroy(Context);
+ Fn = NewFn;
}
if (getLangOptions().CPlusPlus && Fn->getType()->isRecordType())
OpenPOWER on IntegriCloud