diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-13 20:06:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-13 20:06:38 +0000 |
commit | ae2cf767de457df939d07c44b162de5fe0b5e607 (patch) | |
tree | 919264219fd2816f20403a53321ccf23cccf3d07 /lib/Sema/SemaOverload.cpp | |
parent | 7d14d389f0539545715e756629127c1fe5a4773a (diff) |
When complaining about ambiguous overload resolution for a unary or
binary operator, provide the types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index f8c6f6971d..7c51548b2b 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -7163,8 +7163,9 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn, break; case OR_Ambiguous: - Diag(OpLoc, diag::err_ovl_ambiguous_oper) + Diag(OpLoc, diag::err_ovl_ambiguous_oper_unary) << UnaryOperator::getOpcodeStr(Opc) + << Input->getType() << Input->getSourceRange(); CandidateSet.NoteCandidates(*this, OCD_ViableCandidates, Args, NumArgs, @@ -7401,8 +7402,9 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc, } case OR_Ambiguous: - Diag(OpLoc, diag::err_ovl_ambiguous_oper) + Diag(OpLoc, diag::err_ovl_ambiguous_oper_binary) << BinaryOperator::getOpcodeStr(Opc) + << Args[0]->getType() << Args[1]->getType() << Args[0]->getSourceRange() << Args[1]->getSourceRange(); CandidateSet.NoteCandidates(*this, OCD_ViableCandidates, Args, 2, BinaryOperator::getOpcodeStr(Opc), OpLoc); @@ -7543,8 +7545,10 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, } case OR_Ambiguous: - Diag(LLoc, diag::err_ovl_ambiguous_oper) - << "[]" << Args[0]->getSourceRange() << Args[1]->getSourceRange(); + Diag(LLoc, diag::err_ovl_ambiguous_oper_binary) + << "[]" + << Args[0]->getType() << Args[1]->getType() + << Args[0]->getSourceRange() << Args[1]->getSourceRange(); CandidateSet.NoteCandidates(*this, OCD_ViableCandidates, Args, 2, "[]", LLoc); return ExprError(); @@ -8013,8 +8017,8 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc) { return ExprError(); case OR_Ambiguous: - Diag(OpLoc, diag::err_ovl_ambiguous_oper) - << "->" << Base->getSourceRange(); + Diag(OpLoc, diag::err_ovl_ambiguous_oper_unary) + << "->" << Base->getType() << Base->getSourceRange(); CandidateSet.NoteCandidates(*this, OCD_ViableCandidates, &Base, 1); return ExprError(); |