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.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 29be09e8fea..f4a5dea8f94 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -14911,16 +14911,20 @@ ExprResult Sema::CheckPlaceholderExpr(Expr *E) {
case BuiltinType::Overload: {
// Try to resolve a single function template specialization.
// This is obligatory.
- ExprResult result = E;
- if (ResolveAndFixSingleFunctionTemplateSpecialization(result, false)) {
- return result;
+ ExprResult Result = E;
+ if (ResolveAndFixSingleFunctionTemplateSpecialization(Result, false))
+ return Result;
+
+ // No guarantees that ResolveAndFixSingleFunctionTemplateSpecialization
+ // leaves Result unchanged on failure.
+ Result = E;
+ if (resolveAndFixAddressOfOnlyViableOverloadCandidate(Result))
+ return Result;
// If that failed, try to recover with a call.
- } else {
- tryToRecoverWithCall(result, PDiag(diag::err_ovl_unresolvable),
- /*complain*/ true);
- return result;
- }
+ tryToRecoverWithCall(Result, PDiag(diag::err_ovl_unresolvable),
+ /*complain*/ true);
+ return Result;
}
// Bound member functions.
OpenPOWER on IntegriCloud