r207806 - Fix some -Wabsolute-value warnings introduced in r207796.

Reid Kleckner rnk at google.com
Thu May 1 15:56:22 PDT 2014


Does a ::abs(int) overload always exist, or should this be std::abs?


On Thu, May 1, 2014 at 3:23 PM, David Blaikie <dblaikie at gmail.com> wrote:

> Author: dblaikie
> Date: Thu May  1 17:23:56 2014
> New Revision: 207806
>
> URL: http://llvm.org/viewvc/llvm-project?rev=207806&view=rev
> Log:
> Fix some -Wabsolute-value warnings introduced in r207796.
>
> Modified:
>     cfe/trunk/lib/Sema/SemaOverload.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=207806&r1=207805&r2=207806&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu May  1 17:23:56 2014
> @@ -9260,8 +9260,8 @@ struct CompareOverloadCandidatesForDispl
>            L->FailureKind == ovl_fail_too_few_arguments) {
>          if (R->FailureKind == ovl_fail_too_many_arguments ||
>              R->FailureKind == ovl_fail_too_few_arguments) {
> -          int LDist = abs(L->Function->getNumParams() - NumArgs);
> -          int RDist = abs(R->Function->getNumParams() - NumArgs);
> +          int LDist = abs((int)L->Function->getNumParams() -
> (int)NumArgs);
> +          int RDist = abs((int)R->Function->getNumParams() -
> (int)NumArgs);
>            if (LDist == RDist)
>              return L->FailureKind == ovl_fail_too_many_arguments &&
>                     R->FailureKind == ovl_fail_too_few_arguments;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140501/9c5108f1/attachment.html>


More information about the cfe-commits mailing list