This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [committed] libstdc++: Implement "Safe Integral Comparisons" (P0586R2)
- From: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Feb 2020 14:04:55 +0100
- Subject: Re: [committed] libstdc++: Implement "Safe Integral Comparisons" (P0586R2)
- References: <20200217132159.GA1504927@redhat.com>
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.
Christophe