From b112e3cb6025938ef9d8568d318e23e44c0c8fdd Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 27 Feb 2020 15:13:16 +0000 Subject: [PATCH] libstdc++: Fix std::span test failures with _GLIBCXX_ASSERTIONS This fixes several failures with -D_GLIBCXX_ASSERTIONS added to the testsuite flags, such as: FAIL: 23_containers/span/back_assert_neg.cc (test for excess errors) * testsuite/23_containers/span/back_assert_neg.cc: Add #undef before defining _GLIBCXX_ASSERTIONS. * testsuite/23_containers/span/first_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/first_assert_neg.cc: Likewise. * testsuite/23_containers/span/front_assert_neg.cc: Likewise. * testsuite/23_containers/span/index_op_assert_neg.cc: Likewise. * testsuite/23_containers/span/last_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/last_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_3_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_4_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_5_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_6_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_assert_neg.cc: Likewise. --- libstdc++-v3/ChangeLog | 15 +++++++++++++++ .../23_containers/span/back_assert_neg.cc | 1 + .../23_containers/span/first_2_assert_neg.cc | 1 + .../23_containers/span/first_assert_neg.cc | 1 + .../23_containers/span/front_assert_neg.cc | 1 + .../23_containers/span/index_op_assert_neg.cc | 1 + .../23_containers/span/last_2_assert_neg.cc | 1 + .../23_containers/span/last_assert_neg.cc | 1 + .../23_containers/span/subspan_2_assert_neg.cc | 1 + .../23_containers/span/subspan_3_assert_neg.cc | 1 + .../23_containers/span/subspan_4_assert_neg.cc | 1 + .../23_containers/span/subspan_5_assert_neg.cc | 1 + .../23_containers/span/subspan_6_assert_neg.cc | 1 + .../23_containers/span/subspan_assert_neg.cc | 1 + 14 files changed, 28 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 53fc59c6a0d..05d6748ba51 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,20 @@ 2020-02-27 Jonathan Wakely + * testsuite/23_containers/span/back_assert_neg.cc: Add #undef before + defining _GLIBCXX_ASSERTIONS. + * testsuite/23_containers/span/first_2_assert_neg.cc: Likewise. + * testsuite/23_containers/span/first_assert_neg.cc: Likewise. + * testsuite/23_containers/span/front_assert_neg.cc: Likewise. + * testsuite/23_containers/span/index_op_assert_neg.cc: Likewise. + * testsuite/23_containers/span/last_2_assert_neg.cc: Likewise. + * testsuite/23_containers/span/last_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_2_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_3_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_4_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_5_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_6_assert_neg.cc: Likewise. + * testsuite/23_containers/span/subspan_assert_neg.cc: Likewise. + * include/debug/string (__gnu_debug::basic_string::insert): Fix for C++98 where the member function of the base class returns void. diff --git a/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc index f3f2b20851a..76f2a7eb286 100644 --- a/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc index 7b202bdb997..0019fca5b8b 100644 --- a/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc index e10184e04da..7b93abc9a92 100644 --- a/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc index ea99c8b60b8..62dec39c6a0 100644 --- a/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc index 4676b7a83e8..10432ebe72f 100644 --- a/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc index fca1cedcc74..cc12c1f540e 100644 --- a/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc index f831c72a77b..773bea49e57 100644 --- a/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc index 00a94009dc5..a3b856ecd67 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc index c8a5c92e61f..2c559427094 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc index 1ccd5f2db67..8a082633bf1 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc index 685096df077..c3836478b66 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc index 2752aa254c6..a58d763ea9d 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc index 56a91ab34ac..9160489382a 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc @@ -18,6 +18,7 @@ // { dg-options "-std=gnu++2a" } // { dg-do run { xfail c++2a } } +#undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS #include -- 2.30.2