aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-16 19:16:25 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-16 19:16:25 +0000
commitdb2eae639d3b7ed61ceb56890b73168517ef57f1 (patch)
tree5d11c84a6d156510757fa57eadff9acb25f2f1db /lib/Sema/SemaExprCXX.cpp
parent1040c227efc6821cd39795206c178894470a1a48 (diff)
Clean up our handling of template-ids that resolve down to a single
overload, so that we actually do the resolution for full expressions and emit more consistent, useful diagnostics. Also fixes an IRGen crasher, where Sema wouldn't diagnose a resolvable bound member function template-id used in a full-expression (<rdar://problem/9108698>). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index fe0d413a76..9955b0378b 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -3944,14 +3944,17 @@ ExprResult Sema::ActOnFinishFullExpr(Expr *FullExpr) {
// fooT<int>;
if (FullExpr->getType() == Context.OverloadTy) {
- if (!ResolveSingleFunctionTemplateSpecialization(FullExpr,
- /* Complain */ false)) {
- OverloadExpr* OvlExpr = OverloadExpr::find(FullExpr).Expression;
- Diag(FullExpr->getLocStart(), diag::err_addr_ovl_ambiguous)
- << OvlExpr->getName();
- NoteAllOverloadCandidates(OvlExpr);
+ ExprResult Fixed
+ = ResolveAndFixSingleFunctionTemplateSpecialization(FullExpr,
+ /*DoFunctionPointerConversion=*/false,
+ /*Complain=*/true,
+ FullExpr->getSourceRange(),
+ QualType(),
+ diag::err_addr_ovl_ambiguous);
+ if (Fixed.isInvalid())
return ExprError();
- }
+
+ FullExpr = Fixed.get();
}