[committed] libstdc++: Implement "Safe Integral Comparisons" (P0586R2)
Jonathan Wakely
jwakely@redhat.com
Tue Feb 18 18:58:00 GMT 2020
On 18/02/20 14:04 +0100, Christophe Lyon wrote:
>Hi,
>
>On Mon, 17 Feb 2020 at 14:22, Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>> * include/std/type_traits (__is_standard_integer): New helper trait.
>> * include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater)
>> (cmp_less_equal, cmp_greater_equal, in_range): Define for C++20.
>> * include/std/version (__cpp_lib_integer_comparison_functions): Define.
>> * testsuite/20_util/integer_comparisons/1.cc: New test.
>> * testsuite/20_util/integer_comparisons/2.cc: New test.
>> * testsuite/20_util/integer_comparisons/equal.cc: New test.
>> * testsuite/20_util/integer_comparisons/equal_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/greater_equal.cc: New test.
>> * testsuite/20_util/integer_comparisons/greater_equal_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/greater_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/in_range.cc: New test.
>> * testsuite/20_util/integer_comparisons/in_range_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/less.cc: New test.
>> * testsuite/20_util/integer_comparisons/less_equal.cc: New test.
>> * testsuite/20_util/integer_comparisons/less_equal_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/less_neg.cc: New test.
>> * testsuite/20_util/integer_comparisons/not_equal.cc: New test.
>> * testsuite/20_util/integer_comparisons/not_equal_neg.cc: New test.
>>
>> Tested powerpc64le-linux, committed to master.
>>
>
>Some of these new tests fail on arm (and s390 according to gcc-testresults):
>FAIL: 20_util/integer_comparisons/equal.cc execution test
>FAIL: 20_util/integer_comparisons/greater_equal.cc execution test
>FAIL: 20_util/integer_comparisons/less.cc execution test
>FAIL: 20_util/integer_comparisons/less_equal.cc execution test
>FAIL: 20_util/integer_comparisons/not_equal.cc execution test
>
>The log says:
>/libstdc++-v3/testsuite/20_util/integer_comparisons/equal.cc:64: void
>test03(): Assertion '!std::cmp_equal(u, ul)' failed.
>/libstdc++-v3/testsuite/20_util/integer_comparisons/greater_equal.cc:70:
>void test03(): Assertion '!std::cmp_greater_equal(u, ul)' failed.
>/libstdc++-v3/testsuite/20_util/integer_comparisons/less.cc:68: void
>test03(): Assertion 'std::cmp_less(u, ul)' failed.
>/libstdc++-v3/testsuite/20_util/integer_comparisons/less_equal.cc:71:
>void test03(): Assertion '!std::cmp_less_equal(ul, u)' failed.
>/libstdc++-v3/testsuite/20_util/integer_comparisons/not_equal.cc:65:
>void test03(): Assertion 'std::cmp_not_equal(u, ul)' failed.
Fixed with this patch, committed to master.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3828 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20200218/34c4dfbf/attachment.bin>
More information about the Libstdc++
mailing list