diff options
author | John McCall <rjmccall@apple.com> | 2010-01-08 04:41:39 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-08 04:41:39 +0000 |
commit | 81201626aa08bcc9d05c8b3c6a1d38a7d577c3ce (patch) | |
tree | ecf369f64bf8be1b1618fe7d06cd544b3c8dbe80 /lib/Sema/SemaInit.cpp | |
parent | c31176d5ebbcd407aa512bbd5f717e35da629e7d (diff) |
Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones. This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls; users
therefore will want to figure out why some other options were excluded.
Started sorting overload results. Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.
Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index c2a62cbc52..8c45edb21f 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -88,7 +88,7 @@ static bool CheckSingleInitializer(Expr *&Init, QualType DeclType, S.Diag(Init->getSourceRange().getBegin(), diag::err_typecheck_convert_ambiguous) << DeclType << Init->getType() << Init->getSourceRange(); - S.PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false); + S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates); return true; } return false; @@ -3010,14 +3010,14 @@ static Sema::OwningExprResult CopyIfRequiredForEntity(Sema &S, S.Diag(Loc, diag::err_temp_copy_no_viable) << (int)Entity.getKind() << CurInitExpr->getType() << CurInitExpr->getSourceRange(); - S.PrintOverloadCandidates(CandidateSet, false); + S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates); return S.ExprError(); case OR_Ambiguous: S.Diag(Loc, diag::err_temp_copy_ambiguous) << (int)Entity.getKind() << CurInitExpr->getType() << CurInitExpr->getSourceRange(); - S.PrintOverloadCandidates(CandidateSet, true); + S.PrintOverloadCandidates(CandidateSet, Sema::OCD_ViableCandidates); return S.ExprError(); case OR_Deleted: @@ -3432,14 +3432,14 @@ bool InitializationSequence::Diagnose(Sema &S, << DestType << Args[0]->getType() << Args[0]->getSourceRange(); - S.PrintOverloadCandidates(FailedCandidateSet, true); + S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_ViableCandidates); break; case OR_No_Viable_Function: S.Diag(Kind.getLocation(), diag::err_typecheck_nonviable_condition) << Args[0]->getType() << DestType.getNonReferenceType() << Args[0]->getSourceRange(); - S.PrintOverloadCandidates(FailedCandidateSet, false); + S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates); break; case OR_Deleted: { @@ -3541,13 +3541,14 @@ bool InitializationSequence::Diagnose(Sema &S, case OR_Ambiguous: S.Diag(Kind.getLocation(), diag::err_ovl_ambiguous_init) << DestType << ArgsRange; - S.PrintOverloadCandidates(FailedCandidateSet, true); + S.PrintOverloadCandidates(FailedCandidateSet, + Sema::OCD_ViableCandidates); break; case OR_No_Viable_Function: S.Diag(Kind.getLocation(), diag::err_ovl_no_viable_function_in_init) << DestType << ArgsRange; - S.PrintOverloadCandidates(FailedCandidateSet, false); + S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates); break; case OR_Deleted: { |