r207806 - Fix some -Wabsolute-value warnings introduced in r207796.
David Blaikie
dblaikie at gmail.com
Thu May 1 16:09:04 PDT 2014
abs(int) is provided by stdlib.h - but yeah, I think it /can/ be
provided by <cstdlib> without violating the standard, but isn't
required to.
Included <cstdlib> and added "std::" in r207811.
Thanks!
- David
On Thu, May 1, 2014 at 3:56 PM, Reid Kleckner <rnk at google.com> wrote:
> 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
>
>
More information about the cfe-commits
mailing list