From e5bcbcd04cfcb2f8635ea8431f4e77065e44b0bd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 7 Nov 2022 15:15:50 +0100 Subject: libstdc++: Add _Float128 to_chars/from_chars support for x86, ia64 and ppc64le with glibc The following patch adds std::{to,from}_chars support for std::float128_t on glibc 2.26+ for {i?86,x86_64,ia64,powerpc64le}-linux. When long double is already IEEE quad, previous changes already handle it by using long double overloads in _Float128 overloads. The powerpc64le case (with explicit or implicit -mabi=ibmlongdouble) is handled by using the __float128/__ieee128 entrypoints which are already in the library and used for -mabi=ieeelongdouble. For i?86, x86_64 and ia64 this patch adds new library entrypoints, mostly by enabling the code that was already there for powerpc64le-linux. Those use __float128 or __ieee128, the patch uses _Float128 for the exported overloads and internally as template parameter. While powerpc64le-linux uses __sprintfieee128 and __strtoieee128, for _Float128 the patch uses the glibc 2.26 strfromf128 and strtof128 APIs. So that one can build gcc against older glibc and then compile user programs on newer glibc, the patch uses weak references unless gcc is compiled against glibc 2.26+. strfromf128 unfortunately can't handle %.0Lf and %.*Le, %.*Lf, %.*Lg format strings sprintf/__sprintfieee128 use, we need to remove the L from those and replace * with actually directly printing the precision into the format string (i.e. it can handle %.0f and %.27f (floating point type is implied from the function name)). Unlike the std::{,b}float16_t support, this one actually exports APIs with std::float128_t aka _Float128 in the mangled name, because no standard format is superset of it. On the other side, e.g. on i?86/x86_64 it doesn't have restrictions like for _Float16/__bf16 which ISAs need to be enabled in order to use it. The denorm_min case in the testcase is temporarily commented out because of the ERANGE subnormal issue Patrick posted patch for. 2022-11-07 Jakub Jelinek * include/std/charconv (from_chars, to_chars): Add _Float128 overfloads if _GLIBCXX_HAVE_FLOAT128_MATH is defined. * config/abi/pre/gnu.ver (GLIBCXX_3.4.31): Export _ZSt8to_charsPcS_DF128_, _ZSt8to_charsPcS_DF128_St12chars_format, _ZSt8to_charsPcS_DF128_St12chars_formati and _ZSt10from_charsPKcS0_RDF128_St12chars_format. * src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS): Define if needed. (__strtof128): Declare. (from_chars_impl): Handle _Float128. (from_chars): New _Float128 overload if USE_STRTOF128_FOR_FROM_CHARS is define. * src/c++17/floating_to_chars.cc (__strfromf128): Declare. (FLOAT128_TO_CHARS): Define even when _Float128 is supported and wider than long double. (F128_type): Use _Float128 for that case. (floating_type_traits): Specialize for F128_type rather than __float128. (sprintf_ld): Add length argument. Handle _Float128. (__floating_to_chars_shortest, __floating_to_chars_precision): Pass length to sprintf_ld. (to_chars): Add _Float128 overloads for the F128_type being _Float128 cases. * testsuite/20_util/to_chars/float128_c++23.cc: New test. --- .../testsuite/20_util/to_chars/float128_c++23.cc | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc new file mode 100644 index 0000000..4c01458 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc @@ -0,0 +1,105 @@ +// Copyright (C) 2022 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-options "-std=gnu++2b" } +// { dg-do run { target c++23 } } +// { dg-require-effective-target ieee_floats } +// { dg-require-effective-target size32plus } +// { dg-add-options ieee } + +#include +#include +#include +#include +#include + +#if defined(__STDCPP_FLOAT128_T__) \ + && (defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128) \ + || defined(_GLIBCXX_HAVE_FLOAT128_MATH)) +void +test(std::chars_format fmt = std::chars_format{}) +{ + std::float128_t tests[] = { +// std::numeric_limits::denorm_min(), + std::numeric_limits::min(), + 0.0f128, + -42.0f128, + 1234.5678912345f128, + std::numbers::e_v, + std::numbers::log2e_v, + std::numbers::log10e_v, + std::numbers::pi_v, + std::numbers::inv_pi_v, + std::numbers::inv_sqrtpi_v, + std::numbers::ln2_v, + std::numbers::ln10_v, + std::numbers::sqrt2_v, + std::numbers::sqrt3_v, + std::numbers::inv_sqrt3_v, + std::numbers::egamma_v, + std::numbers::phi_v, + std::numeric_limits::max() + }; + char str1[10000], str2[10000]; + for (auto u : tests) + { + auto [ptr1, ec1] = std::to_chars(str1, str1 + sizeof(str1), u, fmt); + VERIFY( ec1 == std::errc() ); +// std::cout << i << ' ' << std::string_view (str1, ptr1) << '\n'; + if (fmt == std::chars_format::fixed) + { + auto [ptr2, ec2] = std::to_chars(str2, str2 + (ptr1 - str1), u, fmt); + VERIFY( ec2 == std::errc() && ptr2 - str2 == ptr1 - str1 ); + auto [ptr3, ec3] = std::to_chars(str2, str2 + (ptr1 - str1 - 1), u, fmt); + VERIFY( ec3 != std::errc() ); + } + std::float128_t v; + auto [ptr4, ec4] = std::from_chars(str1, ptr1, v, + fmt == std::chars_format{} + ? std::chars_format::general : fmt); + VERIFY( ec4 == std::errc() && ptr4 == ptr1 ); + VERIFY( u == v ); + + auto [ptr5, ec5] = std::to_chars(str1, str1 + sizeof(str1), u, fmt, 90); + VERIFY( ec5 == std::errc() ); +// std::cout << i << ' ' << std::string_view (str1, ptr5) << '\n'; + v = 4.0f128; + auto [ptr6, ec6] = std::from_chars(str1, ptr5, v, + fmt == std::chars_format{} + ? std::chars_format::general : fmt); + VERIFY( ec6 == std::errc() && ptr6 == ptr5 ); + if (fmt == std::chars_format::fixed && u > 0.0f128 && u < 0.000001f128) + VERIFY( v == 0.0 ); + else + VERIFY( u == v ); + } +} +#endif + +int +main() +{ +#if defined(__STDCPP_FLOAT128_T__) \ + && (defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128) \ + || defined(_GLIBCXX_HAVE_FLOAT128_MATH)) + test(); + test(std::chars_format::fixed); + test(std::chars_format::scientific); + test(std::chars_format::general); + test(std::chars_format::hex); +#endif +} -- cgit v1.1 From cb0ceeaee9e041aaac3edd089b07b439621d0f29 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 7 Nov 2022 15:17:21 +0100 Subject: libstdc++: Update from latest fast_float [PR107468] The following patch updates from fast_float trunk. That way it grabs two of the 4 LOCAL_PATCHES, some smaller tweaks, to_extended cleanups and most importantly fix for the incorrect rounding case, PR107468 aka https://github.com/fastfloat/fast_float/issues/149 Using std::fegetround showed in benchmarks too slow, so instead of doing that the patch limits the fast path where it uses floating point multiplication rather than integral to cases where we can prove there will be no rounding (the multiplication will be exact, not just that the two multiplication or division operation arguments are exactly representable). 2022-11-07 Jakub Jelinek PR libstdc++/107468 * src/c++17/fast_float/MERGE: Adjust for merge from upstream. * src/c++17/fast_float/LOCAL_PATCHES: Remove commits that were upstreamed. * src/c++17/fast_float/README.md: Merge from fast_float 662497742fea7055f0e0ee27e5a7ddc382c2c38e commit. * src/c++17/fast_float/fast_float.h: Likewise. * testsuite/20_util/from_chars/pr107468.cc: New test. --- .../testsuite/20_util/from_chars/pr107468.cc | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 libstdc++-v3/testsuite/20_util/from_chars/pr107468.cc (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/20_util/from_chars/pr107468.cc b/libstdc++-v3/testsuite/20_util/from_chars/pr107468.cc new file mode 100644 index 0000000..95bf669 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/from_chars/pr107468.cc @@ -0,0 +1,42 @@ +// Copyright (C) 2022 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do run { target c++17 } } +// { dg-add-options ieee } + +#include +#include +#include +#include + +int +main() +{ + // FP from_char not available otherwise. +#if __cpp_lib_to_chars >= 201611L \ + && _GLIBCXX_USE_C99_FENV_TR1 \ + && defined(FE_DOWNWARD) \ + && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32) + // PR libstdc++/107468 + float f; + char buf[] = "3.355447e+07"; + std::fesetround(FE_DOWNWARD); + auto [ptr, ec] = std::from_chars(buf, buf + sizeof(buf) - 1, f, std::chars_format::scientific); + VERIFY( ec == std::errc() && ptr == buf + sizeof(buf) - 1 ); + VERIFY( f == 33554472.0f ); +#endif +} -- cgit v1.1 From f471cb71c86c1e7a3dead324142bdf880f00a3da Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Mon, 7 Nov 2022 13:29:30 -0500 Subject: libstdc++: Implement ranges::cartesian_product_view from P2374R4 This also implements the proposed resolutions of the tentatively ready LWG issues 3760, 3761 and 3801 for cartesian_product_view. I'm not sure how/if we should implement the recommended practice of: iterator::difference_type should be the smallest signed-integer-like type that is sufficiently wide to store the product of the maximum sizes of all underlying ranges if such a type exists because for e.g. extern std::vector x, y; auto v = views::cartesian_product(x, y); IIUC it'd mean difference_type should be __int128 (on 64-bit systems), which seems quite wasteful: in practice the size of any cartesian product probably won't exceed the precision of say ptrdiff_t, and using anything larger will just incur unnecessary space/time overhead. It's also probably not worth the complexity to use less precision than ptrdiff_t (when possible) either. So this patch defines difference_type as common_type_t, range_difference_t<_Vs>...> which should mean it's least as large as the difference_type of each underlying range, and at least as large as ptrdiff_t. This patch also adds assertions to catch any overflow that occurs due to this choice of difference_type. libstdc++-v3/ChangeLog: * include/std/ranges (__maybe_const_t): New alias for __detail::__maybe_const_t. (__detail::__cartesian_product_is_random_access): Define. (__detail::__cartesian_product_common_arg): Define. (__detail::__cartesian_product_is_bidirectional): Define. (__detail::__cartesian_product_is_common): Define. (__detail::__cartesian_product_is_sized): Define. (__detail::__cartesian_is_sized_sentinel): Define. (__detail::__cartesian_common_arg_end): Define. (cartesian_product_view): Define. (cartesian_product_view::_Iterator): Define. (views::__detail::__can_cartesian_product_view): Define. (views::_CartesianProduct, views::cartesian_product): Define. * testsuite/std/ranges/cartesian_product/1.cc: New test. --- .../testsuite/std/ranges/cartesian_product/1.cc | 186 +++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc b/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc new file mode 100644 index 0000000..d6e4b53 --- /dev/null +++ b/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc @@ -0,0 +1,186 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include +#include +#include + +namespace ranges = std::ranges; +namespace views = std::views; + +constexpr bool +test01() +{ + int x[] = {1, 2, 3}; + int y[] = {4, 5, 6}; + int z[] = {7, 8}; + int w[] = {9}; + + auto v0 = views::cartesian_product(); + VERIFY( ranges::end(v0) - ranges::begin(v0) == 0 ); + VERIFY( ranges::size(v0) == 0 ); + VERIFY( ranges::empty(v0) ); + + auto v1 = views::cartesian_product(x); + VERIFY( ranges::end(v1) - ranges::begin(v1) == 3 ); + VERIFY( ranges::size(v1) == 3 ); + VERIFY( ranges::equal(v1 | views::keys, x) ); + VERIFY( std::get<0>(v1[0]) == 1 ); + VERIFY( std::get<0>(v1[1]) == 2 ); + VERIFY( std::get<0>(v1[2]) == 3 ); + VERIFY( ranges::equal(v1 | views::reverse | views::keys, x | views::reverse)); + + auto v2 = views::cartesian_product(x, y); + VERIFY( ranges::size(v2) == 9 ); + VERIFY( ranges::end(v2) - ranges::begin(v2) == 9 ); + VERIFY( ranges::equal(v2 | views::keys, (int[]){1, 1, 1, 2, 2, 2, 3, 3, 3})); + VERIFY( ranges::equal(v2 | views::values, (int[]){4, 5, 6, 4, 5, 6, 4, 5, 6})); + VERIFY( ranges::equal(v2 | views::reverse | views::keys, (int[]){3, 3, 3, 2, 2, 2, 1, 1, 1}) ); + VERIFY( ranges::equal(v2 | views::reverse | views::values, (int[]){6, 5, 4, 6, 5, 4, 6, 5, 4}) ); + + auto v3 = views::cartesian_product(x, y, z); + VERIFY( ranges::size(v3) == 18 ); + VERIFY( ranges::equal(v3, (std::tuple[]){{1,4,7}, {1,4,8}, {1,5,7}, {1,5,8}, + {1,6,7}, {1,6,8}, {2,4,7}, {2,4,8}, + {2,5,7}, {2,5,8}, {2,6,7}, {2,6,8}, + {3,4,7}, {3,4,8}, {3,5,7}, {3,5,8}, + {3,6,7}, {3,6,8}}) ); + + auto v4 = views::cartesian_product(x, y, z, w); + VERIFY( ranges::size(v4) == 18 ); + VERIFY( ranges::equal(v4 | views::elements<3>, views::repeat(9, 18)) ); + + auto i4 = v4.begin(), j4 = i4 + 1; + VERIFY( j4 > i4 ); + VERIFY( i4[0] == std::tuple(1, 4, 7, 9) ); + VERIFY( i4 + 18 == v4.end() ); + i4 += 5; + VERIFY( i4 != v4.begin() ); + VERIFY( i4 - 5 == v4.begin() ); + VERIFY( *i4 == std::tuple(1, 6, 8, 9) ); + VERIFY( i4 - 5 != i4 ); + i4 -= 3; + VERIFY( *i4 == std::tuple(1, 5, 7, 9) ); + VERIFY( j4 + 1 == i4 ); + ranges::iter_swap(i4, j4); + VERIFY( *j4 == std::tuple(1, 5, 7, 9) ); + VERIFY( *i4 == std::tuple(1, 4, 8, 9) ); + + return true; +} + +void +test02() +{ + int x[] = {1, 2}; + __gnu_test::test_input_range rx(x); + auto v = views::cartesian_product(rx, x); + auto i = v.begin(); + std::default_sentinel_t s = v.end(); + VERIFY( i != s ); + VERIFY( std::get<0>(*i) == 1 && std::get<1>(*i) == 1 ); + ++i; + VERIFY( i != s ); + VERIFY( std::get<0>(*i) == 1 && std::get<1>(*i) == 2 ); + ++i; + VERIFY( i != s ); + VERIFY( std::get<0>(*i) == 2 && std::get<1>(*i) == 1 ); + ++i; + VERIFY( i != s ); + VERIFY( std::get<0>(*i) == 2 && std::get<1>(*i) == 2 ); + ++i; + VERIFY( i == s ); +} + +void +test03() +{ + int x[2]; + __gnu_test::test_input_range rx(x); + auto v = views::cartesian_product(views::counted(rx.begin(), 2), x); + VERIFY( v.size() == 4 ); + auto i = v.begin(); + std::default_sentinel_t s = v.end(); + VERIFY( i - s == -4 ); + VERIFY( s - i == 4 ); + ++i; + VERIFY( i - s == -3 ); + VERIFY( s - i == 3 ); + ++i; + VERIFY( i - s == -2 ); + VERIFY( s - i == 2 ); + ++i; + VERIFY( i - s == -1 ); + VERIFY( s - i == 1 ); + ++i; + VERIFY( i - s == 0 ); + VERIFY( s - i == 0 ); +} + +void +test04() +{ + // Exhaustively verify correctness of our iterator addition implementation + // (which runs in constant time) for this 24-element cartesian_product_view. + int x[4], y[3], z[2], w[1]; + auto v = views::cartesian_product(x, y, z, w); + + auto n = ranges::ssize(v); + for (int i = 0; i <= n; i++) + for (int j = 0; i + j <= n; j++) + { + auto b1 = v.begin(); + for (int k = 0; k < i + j; k++) + ++b1; + VERIFY( b1 - v.begin() == i + j ); + auto b2 = (v.begin() + i) + j; + auto b3 = v.begin() + (i + j); + VERIFY( b1 == b2 && b2 == b3 ); + + auto e1 = v.end(); + for (int k = 0; k < i + j; k++) + --e1; + VERIFY( v.end() - e1 == i + j ); + auto e2 = (v.end() - i) - j; + auto e3 = v.end() - (i + j); + VERIFY( e1 == e2 && e2 == e3 ); + } +} + +void +test05() +{ +#if __SIZEOF_INT128__ + auto r = views::iota(__int128(0), __int128(5)); +#else + auto r = views::iota(0ll, 5ll); +#endif + auto v = views::cartesian_product(r, r); + VERIFY( ranges::size(v) == 25 ); + VERIFY( v.end() - v.begin() == 25 ); + VERIFY( v.begin() + ranges::ssize(v) - v.begin() == 25 ); +} + +constexpr bool +test06() +{ + int x[] = {1, 2, 3}; + auto v = views::cartesian_product(x, views::empty, x); + VERIFY( ranges::size(v) == 0 ); + VERIFY( ranges::begin(v) == ranges::end(v) ); + VERIFY( ranges::begin(v) - ranges::begin(v) == 0 ); + + return true; +} + +int +main() +{ + static_assert(test01()); + test02(); + test03(); + test04(); + test05(); + static_assert(test06()); +} -- cgit v1.1 From 2ee0165f72be96083deaa8fd315bcfed011acd52 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Mon, 7 Nov 2022 13:29:42 -0500 Subject: libstdc++: Implement ranges::as_rvalue_view from P2446R2 libstdc++-v3/ChangeLog: * include/std/ranges (as_rvalue_view): Define. (enable_borrowed_range): Define. (views::__detail::__can_as_rvalue_view): Define. (views::_AsRvalue, views::as_rvalue): Define. * testsuite/std/ranges/adaptors/as_rvalue/1.cc: New test. --- .../testsuite/std/ranges/adaptors/as_rvalue/1.cc | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc new file mode 100644 index 0000000..8ca4f50 --- /dev/null +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++23" } +// { dg-do run { target c++23 } } + +#include +#include +#include +#include +#include + +namespace ranges = std::ranges; +namespace views = std::views; + +constexpr bool +test01() +{ + + std::unique_ptr a[3] = { std::make_unique(1), + std::make_unique(2), + std::make_unique(3) }; + std::unique_ptr b[3]; + auto v = a | views::as_rvalue; + ranges::copy(v, b); + VERIFY( ranges::all_of(a, [](auto& p) { return p.get() == nullptr; }) ); + VERIFY( ranges::equal(b | views::transform([](auto& p) { return *p; }), (int[]){1, 2, 3}) ); + + return true; +} + +void +test02() +{ + std::unique_ptr x = std::make_unique(42); + std::unique_ptr y; + __gnu_test::test_input_range rx(&x, &x+1); + auto v = rx | views::as_rvalue; + static_assert(!ranges::common_range); + ranges::copy(v, &y); + VERIFY( x.get() == nullptr ); + VERIFY( *y == 42 ); +} + +int +main() +{ + static_assert(test01()); + test02(); +} -- cgit v1.1 From 431be04b8b6e31d950ddab340ed866d197d23d4d Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 4 Nov 2022 15:22:45 -0400 Subject: c++: implement P2468R2, the equality operator you are looking for This paper is resolving the problem of well-formed C++17 code becoming ambiguous in C++20 due to asymmetrical operator== being compared with itself in reverse. I had previously implemented a tiebreaker such that if the two candidates were functions with the same parameter types, we would prefer the non-reversed candidate. But the committee went with a different approach: if there's an operator!= with the same parameter types as the operator==, don't consider the reversed form of the ==. So this patch implements that, and changes my old tiebreaker to give a pedwarn if it is used. I also noticed that we were giving duplicate errors for some testcases, and fixed the tourney logic to avoid that. As a result, a lot of tests of the form struct A { bool operator==(const A&); }; need to be fixed to add a const function-cv-qualifier, e.g. struct A { bool operator==(const A&) const; }; The committee thought such code ought to be fixed, so breaking it was fine. 18_support/comparisons/algorithms/fallback.cc also breaks with this patch, because of the similarly asymmetrical bool operator==(const S&, S&) { return true; } As a result, some of the asserts need to be reversed. The H test in spaceship-eq15.C is specified in the standard to be well-formed because the op!= in the inline namespace is not found by the search, but that seems wrong to me. I've implemented that behavior, but disabled it for now; if we decide that is the way we want to go, we can just remove the "0 &&" in add_candidates to enable it. Co-authored-by: Jakub Jelinek gcc/cp/ChangeLog: * cp-tree.h (fns_correspond): Declare. * decl.cc (fns_correspond): New. * call.cc (add_candidates): Look for op!= matching op==. (joust): Complain about non-standard reversed tiebreaker. (tourney): Fix champ_compared_to_predecessor logic. (build_new_op): Don't complain about error_mark_node not having 'bool' type. * pt.cc (tsubst_copy_and_build): Don't try to be permissive when seen_error(). gcc/testsuite/ChangeLog: * g++.dg/cpp2a/spaceship-eq15.C: New test. * g++.dg/cpp0x/defaulted3.C: Add const. * g++.dg/cpp2a/bit-cast7.C: Add const. * g++.dg/cpp2a/spaceship-rewrite1.C: Expect error. * g++.dg/cpp2a/spaceship-rewrite5.C: Expect error. * g++.old-deja/g++.jason/byval2.C: Expect error. * g++.old-deja/g++.other/overload13.C: Add const. libstdc++-v3/ChangeLog: * testsuite/18_support/comparisons/algorithms/fallback.cc: Adjust asserts. --- .../testsuite/18_support/comparisons/algorithms/fallback.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc b/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc index 05e1bf7..8bf78fa 100644 --- a/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc +++ b/libstdc++-v3/testsuite/18_support/comparisons/algorithms/fallback.cc @@ -31,12 +31,12 @@ template using adl::S; -static_assert( has_strong_order_fallback ); +static_assert( ! has_strong_order_fallback ); static_assert( has_strong_order_fallback ); static_assert( ! has_strong_order_fallback ); -static_assert( has_weak_order_fallback ); +static_assert( ! has_weak_order_fallback ); static_assert( has_weak_order_fallback ); static_assert( ! has_weak_order_fallback ); -static_assert( has_partial_order_fallback ); +static_assert( ! has_partial_order_fallback ); static_assert( ! has_partial_order_fallback ); // LWG 3465 static_assert( ! has_partial_order_fallback ); -- cgit v1.1 From ee86bdd1d367bc174d7b50bd2ffa5622c4766322 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Nov 2022 11:19:25 +0100 Subject: libstdc++: Uncomment denorm_min test As r13-3609-g6d9dbdf51f9afe8 has been committed, we can now enable even the denorm_min test. 2022-11-08 Jakub Jelinek * testsuite/20_util/to_chars/float128_c++23.cc (test): Uncomment denorm_min test. --- libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc index 4c01458..28824c9 100644 --- a/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc +++ b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc @@ -34,7 +34,7 @@ void test(std::chars_format fmt = std::chars_format{}) { std::float128_t tests[] = { -// std::numeric_limits::denorm_min(), + std::numeric_limits::denorm_min(), std::numeric_limits::min(), 0.0f128, -42.0f128, -- cgit v1.1