diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 06:25:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 06:25:27 +0000 |
commit | d162584991885ab004a02573a73ce06422b921fc (patch) | |
tree | 0d8c56d85205a22c6c06b712a468afcd10429c4b /lib/Sema/SemaOverload.cpp | |
parent | d9d22dd9c94618490dbffb0e2caf222530ca39d3 (diff) |
Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 976b4f78a9..3321ef19b2 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -1481,8 +1481,7 @@ Sema::PerformObjectArgumentInitialization(Expr *&From, CXXMethodDecl *Method) { if (ICS.ConversionKind == ImplicitConversionSequence::BadConversion) return Diag(From->getSourceRange().getBegin(), diag::err_implicit_object_parameter_init) - << ImplicitParamType.getAsString() << From->getType().getAsString() - << From->getSourceRange(); + << ImplicitParamType << From->getType() << From->getSourceRange(); if (ICS.Standard.Second == ICK_Derived_To_Base && CheckDerivedToBaseConversion(From->getType(), ImplicitParamType, @@ -2874,7 +2873,7 @@ Sema::PrintOverloadCandidates(OverloadCandidateSet& CandidateSet, if (isReference) FnType = Context.getReferenceType(FnType); Diag(Cand->Surrogate->getLocation(), diag::err_ovl_surrogate_cand) - << FnType.getAsString(); + << FnType; } else { // FIXME: We need to get the identifier in here // FIXME: Do we want the error message to point at the @@ -2885,8 +2884,7 @@ Sema::PrintOverloadCandidates(OverloadCandidateSet& CandidateSet, Cand->Conversions.size(), false, 0); - Diag(SourceLocation(), diag::err_ovl_builtin_candidate) - << FnType.getAsString(); + Diag(SourceLocation(), diag::err_ovl_builtin_candidate) << FnType; } } } @@ -3052,7 +3050,7 @@ Sema::BuildCallToObjectOfClassType(Expr *Object, SourceLocation LParenLoc, case OR_No_Viable_Function: Diag(Object->getSourceRange().getBegin(), diag::err_ovl_no_viable_object_call) - << Object->getType().getAsString() << (unsigned)CandidateSet.size() + << Object->getType() << (unsigned)CandidateSet.size() << Object->getSourceRange(); PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false); break; @@ -3060,7 +3058,7 @@ Sema::BuildCallToObjectOfClassType(Expr *Object, SourceLocation LParenLoc, case OR_Ambiguous: Diag(Object->getSourceRange().getBegin(), diag::err_ovl_ambiguous_object_call) - << Object->getType().getAsString() << Object->getSourceRange(); + << Object->getType() << Object->getSourceRange(); PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/true); break; } @@ -3212,7 +3210,7 @@ Sema::BuildOverloadedArrowExpr(Expr *Base, SourceLocation OpLoc, case OR_No_Viable_Function: if (CandidateSet.empty()) Diag(OpLoc, diag::err_typecheck_member_reference_arrow) - << BasePtr->getType().getAsString() << BasePtr->getSourceRange(); + << BasePtr->getType() << BasePtr->getSourceRange(); else Diag(OpLoc, diag::err_ovl_no_viable_oper) << "operator->" << (unsigned)CandidateSet.size() @@ -3222,8 +3220,7 @@ Sema::BuildOverloadedArrowExpr(Expr *Base, SourceLocation OpLoc, case OR_Ambiguous: Diag(OpLoc, diag::err_ovl_ambiguous_oper) - << "operator->" - << BasePtr->getSourceRange(); + << "operator->" << BasePtr->getSourceRange(); PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/true); return true; } |