Commit graph

203986 commits

Author SHA1 Message Date
Jonathan Wakely
ed8fcd0df5 libstdc++: Remove dg-options "-std=gnu++2a" from XFAIL std::span tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

We can also combine the { dg-require-effective-target c++2a } directive
with the dg-do selector.

We need to add the no_pch options for tests that define
_GLIBCXX_ASSERTIONS in the test, otherwise the PCH is included without
that defined.

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/span/back_assert_neg.cc: Remove
	dg-options and add effective target selector to dg-do. Add
	no_pch.
	* testsuite/23_containers/span/back_neg.cc: Likewise.
	* testsuite/23_containers/span/cons_1_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/cons_2_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/first_2_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/first_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/first_neg.cc: Likewise.
	* testsuite/23_containers/span/front_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/front_neg.cc: Likewise.
	* testsuite/23_containers/span/index_op_assert_neg.cc: Likewise.
	* testsuite/23_containers/span/index_op_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/last_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.
	* testsuite/23_containers/span/subspan_neg.cc: Likewise.
	* testsuite/24_iterators/range_operations/advance_debug_neg.cc:
	Likewise.
2023-09-15 21:57:40 +01:00
Jonathan Wakely
7810fb3a14 libstdc++: Remove dg-options "-std=gnu++23" from remaining tests
The testsuite will automatically select C++23 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++26
as well.

libstdc++-v3/ChangeLog:

	* testsuite/18_support/headers/limits/synopsis_cxx23.cc: Remove
	dg-options.
	* testsuite/18_support/headers/stdfloat/types_std.cc: Likewise.
	* testsuite/18_support/type_info/constexpr.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/current.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/synopsis.cc: Likewise.
	* testsuite/19_diagnostics/stacktrace/version.cc: Likewise.
	* testsuite/20_util/aligned_storage/deprecated-2b.cc: Likewise.
	* testsuite/20_util/aligned_union/deprecated-2b.cc: Likewise.
	* testsuite/20_util/bitset/access/constexpr.cc: Likewise.
	* testsuite/20_util/bitset/cons/constexpr_c++23.cc: Likewise.
	* testsuite/20_util/bitset/count/constexpr.cc: Likewise.
	* testsuite/20_util/bitset/ext/constexpr.cc: Likewise.
	* testsuite/20_util/bitset/operations/constexpr_c++23.cc:
	Likewise.
	* testsuite/20_util/bitset/version.cc: Likewise.
	* testsuite/20_util/from_chars/8.cc: Likewise.
	* testsuite/20_util/from_chars/constexpr.cc: Likewise.
	* testsuite/20_util/function/cons/deduction_c++23.cc: Likewise.
	* testsuite/20_util/function_objects/invoke/4.cc: Likewise.
	* testsuite/20_util/function_objects/invoke/dangling_ref.cc:
	Likewise.
	* testsuite/20_util/is_scoped_enum/value.cc: Likewise.
	* testsuite/20_util/is_scoped_enum/version.cc: Likewise.
	* testsuite/20_util/move_only_function/call.cc: Likewise.
	* testsuite/20_util/move_only_function/cons.cc: Likewise.
	* testsuite/20_util/move_only_function/move.cc: Likewise.
	* testsuite/20_util/move_only_function/version.cc: Likewise.
	* testsuite/20_util/optional/monadic/and_then.cc: Likewise.
	* testsuite/20_util/optional/monadic/or_else.cc: Likewise.
	* testsuite/20_util/optional/monadic/or_else_neg.cc: Likewise.
	* testsuite/20_util/optional/monadic/pr109242.cc: Likewise.
	* testsuite/20_util/optional/monadic/transform.cc: Likewise.
	* testsuite/20_util/pair/p2321r2.cc: Likewise.
	* testsuite/20_util/reference_from_temporary/value.cc: Likewise.
	* testsuite/20_util/reference_from_temporary/value2.cc:
	Likewise.
	* testsuite/20_util/reference_from_temporary/version.cc:
	Likewise.
	* testsuite/20_util/to_chars/constexpr.cc: Likewise.
	* testsuite/20_util/to_chars/float128_c++23.cc: Likewise.
	* testsuite/20_util/to_chars/float16_c++23.cc: Likewise.
	* testsuite/20_util/to_chars/version.cc: Likewise.
	* testsuite/20_util/to_underlying/1.cc: Likewise.
	* testsuite/20_util/to_underlying/version.cc: Likewise.
	* testsuite/20_util/tuple/p2321r2.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/constexpr.cc: Likewise.
	* testsuite/20_util/unique_ptr/comparison/constexpr.cc:
	Likewise.
	* testsuite/20_util/unique_ptr/cons/constexpr_c++20.cc:
	Likewise.
	* testsuite/20_util/unique_ptr/creation/constexpr.cc: Likewise.
	* testsuite/20_util/unique_ptr/modifiers/constexpr.cc: Likewise.
	* testsuite/20_util/unique_ptr/specialized_algorithms/constexpr.cc: Likewise.
	* testsuite/20_util/unreachable/1.cc: Likewise.
	* testsuite/20_util/unreachable/version.cc: Likewise.
	* testsuite/20_util/uses_allocator/lwg3677.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc: Likewise.
	* testsuite/21_strings/basic_string/operations/contains/char.cc:
	Likewise.
	* testsuite/21_strings/basic_string/operations/contains/nonnull.cc: Likewise.
	* testsuite/21_strings/basic_string/operations/contains/wchar_t.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: Likewise.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/contains/char.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/contains/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/contains/nonnull.cc: Likewise.
	* testsuite/21_strings/basic_string_view/operations/contains/wchar_t.cc: Likewise.
	* testsuite/23_containers/queue/cons_from_iters.cc: Likewise.
	* testsuite/23_containers/stack/cons_from_iters.cc: Likewise.
	* testsuite/23_containers/vector/bool/element_access/1.cc:
	Likewise.
	* testsuite/24_iterators/const_iterator/1.cc: Likewise.
	* testsuite/25_algorithms/contains/1.cc: Likewise.
	* testsuite/25_algorithms/contains_subrange/1.cc: Likewise.
	* testsuite/25_algorithms/find_last/1.cc: Likewise.
	* testsuite/25_algorithms/find_last_if/1.cc: Likewise.
	* testsuite/25_algorithms/find_last_if_not/1.cc: Likewise.
	* testsuite/25_algorithms/fold_left/1.cc: Likewise.
	* testsuite/25_algorithms/fold_right/1.cc: Likewise.
	* testsuite/25_algorithms/iota/1.cc: Likewise.
	* testsuite/26_numerics/bit/bit.byteswap/byteswap.cc: Likewise.
	* testsuite/26_numerics/bit/bit.byteswap/version.cc: Likewise.
	* testsuite/26_numerics/complex/ext_c++23.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/c99_classification_macros_c++23.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc:
	Likewise.
	* testsuite/26_numerics/headers/cmath/functions_std_c++23.cc:
	Likewise.
	* testsuite/26_numerics/headers/cmath/nextafter_c++23.cc:
	Likewise.
	* testsuite/26_numerics/numbers/4.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/volatile_ptr.cc: Likewise.
	* testsuite/27_io/filesystem/path/native/conv_c++23.cc:
	Likewise.
	* testsuite/27_io/spanstream/1.cc: Likewise.
	* testsuite/27_io/spanstream/2.cc: Likewise.
	* testsuite/27_io/spanstream/version.cc: Likewise.
	* testsuite/29_atomics/atomic_float/requirements_cxx23.cc:
	Likewise.
	* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc:
	Likewise.
	* testsuite/29_atomics/headers/stdatomic.h/version.cc: Likewise.
	* testsuite/30_threads/packaged_task/cons/deduction_c++23.cc:
	Likewise.
	* testsuite/experimental/filesystem/path/native/conv_c++23.cc:
	Likewise.
	* testsuite/std/ranges/adaptors/adjacent/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/adjacent_transform/1.cc:
	Likewise.
	* testsuite/std/ranges/adaptors/as_const/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/as_rvalue/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/chunk/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/chunk_by/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/enumerate/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/join_with/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/lwg3715.cc: Likewise.
	* testsuite/std/ranges/adaptors/slide/1.cc: Likewise.
	* testsuite/std/ranges/adaptors/stride/1.cc: Likewise.
	* testsuite/std/ranges/cartesian_product/1.cc: Likewise.
	* testsuite/std/ranges/range_adaptor_closure.cc: Likewise.
	* testsuite/std/ranges/repeat/1.cc: Likewise.
	* testsuite/std/ranges/version_c++23.cc: Likewise.
	* testsuite/std/ranges/zip/1.cc: Likewise.
	* testsuite/std/ranges/zip_transform/1.cc: Likewise.
2023-09-15 21:57:40 +01:00
Jonathan Wakely
5188b4028d libstdc++: Remove dg-options "-std=gnu++23" from std::expected tests
The testsuite will automatically select C++23 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++26
as well.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/expected/assign.cc: Remove dg-options.
	* testsuite/20_util/expected/bad.cc: Likewise.
	* testsuite/20_util/expected/cons.cc: Likewise.
	* testsuite/20_util/expected/equality.cc: Likewise.
	* testsuite/20_util/expected/illformed_neg.cc: Likewise.
	* testsuite/20_util/expected/lwg3877.cc: Likewise.
	* testsuite/20_util/expected/lwg3938.cc: Likewise.
	* testsuite/20_util/expected/monadic.cc: Likewise.
	* testsuite/20_util/expected/observers.cc: Likewise.
	* testsuite/20_util/expected/requirements.cc: Likewise.
	* testsuite/20_util/expected/swap.cc: Likewise.
	* testsuite/20_util/expected/synopsis.cc: Likewise.
	* testsuite/20_util/expected/unexpected.cc: Likewise.
	* testsuite/20_util/expected/version.cc: Likewise.
2023-09-15 21:57:40 +01:00
Jonathan Wakely
41cd9d4dfe libstdc++: Remove dg-options "-std=gnu++20" from std::chrono tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/duration/arithmetic/overflow_c++20.cc:
	Remove dg-options.
	* testsuite/20_util/duration/io.cc: Likewise.
	* testsuite/std/time/clock/file/io.cc: Likewise.
	* testsuite/std/time/clock/file/members.cc: Likewise.
	* testsuite/std/time/clock/file/overview.cc: Likewise.
	* testsuite/std/time/clock/gps/1.cc: Likewise.
	* testsuite/std/time/clock/gps/io.cc: Likewise.
	* testsuite/std/time/clock/local/io.cc: Likewise.
	* testsuite/std/time/clock/system/io.cc: Likewise.
	* testsuite/std/time/clock/tai/1.cc: Likewise.
	* testsuite/std/time/clock/tai/io.cc: Likewise.
	* testsuite/std/time/clock/utc/1.cc: Likewise.
	* testsuite/std/time/clock/utc/io.cc: Likewise.
	* testsuite/std/time/clock/utc/leap_second_info.cc: Likewise.
	* testsuite/std/time/day/1.cc: Likewise.
	* testsuite/std/time/day/io.cc: Likewise.
	* testsuite/std/time/exceptions.cc: Likewise.
	* testsuite/std/time/format.cc: Likewise.
	* testsuite/std/time/hh_mm_ss/1.cc: Likewise.
	* testsuite/std/time/hh_mm_ss/109772.cc: Likewise.
	* testsuite/std/time/hh_mm_ss/io.cc: Likewise.
	* testsuite/std/time/is_am/1.cc: Likewise.
	* testsuite/std/time/is_pm/1.cc: Likewise.
	* testsuite/std/time/make12/1.cc: Likewise.
	* testsuite/std/time/make24/1.cc: Likewise.
	* testsuite/std/time/month/1.cc: Likewise.
	* testsuite/std/time/month/io.cc: Likewise.
	* testsuite/std/time/month_day/1.cc: Likewise.
	* testsuite/std/time/month_day/io.cc: Likewise.
	* testsuite/std/time/month_day_last/1.cc: Likewise.
	* testsuite/std/time/month_day_last/io.cc: Likewise.
	* testsuite/std/time/month_weekday/1.cc: Likewise.
	* testsuite/std/time/month_weekday/io.cc: Likewise.
	* testsuite/std/time/month_weekday_last/1.cc: Likewise.
	* testsuite/std/time/month_weekday_last/io.cc: Likewise.
	* testsuite/std/time/parse.cc: Likewise.
	* testsuite/std/time/syn_c++20.cc: Likewise.
	* testsuite/std/time/time_zone/get_info_local.cc: Likewise.
	* testsuite/std/time/time_zone/get_info_sys.cc: Likewise.
	* testsuite/std/time/time_zone/requirements.cc: Likewise.
	* testsuite/std/time/traits/is_clock.cc: Likewise.
	* testsuite/std/time/tzdb/1.cc: Likewise.
	* testsuite/std/time/tzdb/leap_seconds.cc: Likewise.
	* testsuite/std/time/tzdb_list/1.cc: Likewise.
	* testsuite/std/time/tzdb_list/requirements.cc: Likewise.
	* testsuite/std/time/weekday/1.cc: Likewise.
	* testsuite/std/time/weekday/io.cc: Likewise.
	* testsuite/std/time/weekday_indexed/io.cc: Likewise.
	* testsuite/std/time/weekday_last/1.cc: Likewise.
	* testsuite/std/time/weekday_last/io.cc: Likewise.
	* testsuite/std/time/year/1.cc: Likewise.
	* testsuite/std/time/year/2.cc: Likewise.
	* testsuite/std/time/year/io.cc: Likewise.
	* testsuite/std/time/weekday_indexed/1.cc: Likewise.
	* testsuite/std/time/year_month/1.cc: Likewise.
	* testsuite/std/time/year_month/2.cc: Likewise.
	* testsuite/std/time/year_month/io.cc: Likewise.
	* testsuite/std/time/year_month_day/1.cc: Likewise.
	* testsuite/std/time/year_month_day/2.cc: Likewise.
	* testsuite/std/time/year_month_day/3.cc: Likewise.
	* testsuite/std/time/year_month_day/4.cc: Likewise.
	* testsuite/std/time/year_month_day/io.cc: Likewise.
	* testsuite/std/time/year_month_day_last/1.cc: Likewise.
	* testsuite/std/time/year_month_day_last/2.cc: Likewise.
	* testsuite/std/time/year_month_day_last/io.cc: Likewise.
	* testsuite/std/time/year_month_weekday/1.cc: Likewise.
	* testsuite/std/time/year_month_weekday/2.cc: Likewise.
	* testsuite/std/time/year_month_weekday/3.cc: Likewise.
	* testsuite/std/time/year_month_weekday/io.cc: Likewise.
	* testsuite/std/time/year_month_weekday_last/1.cc: Likewise.
	* testsuite/std/time/year_month_weekday_last/2.cc: Likewise.
	* testsuite/std/time/year_month_weekday_last/io.cc: Likewise.
	* testsuite/std/time/zoned_time/1.cc: Likewise.
	* testsuite/std/time/zoned_time/custom.cc: Likewise.
	* testsuite/std/time/zoned_time/deduction.cc: Likewise.
	* testsuite/std/time/zoned_time/io.cc: Likewise.
	* testsuite/std/time/zoned_time/req_neg.cc: Likewise.
	* testsuite/std/time/zoned_time/requirements.cc: Likewise.
	* testsuite/std/time/zoned_traits.cc: Likewise.
2023-09-15 21:57:39 +01:00
Jonathan Wakely
4c0fbba393 libstdc++: Remove dg-options "-std=gnu++20" from std::format tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/std/format/arguments/args.cc: Remove dg-options.
	* testsuite/std/format/arguments/lwg3810.cc: Likewise.
	* testsuite/std/format/error.cc: Likewise.
	* testsuite/std/format/format_string.cc: Likewise.
	* testsuite/std/format/formatter/concept.cc: Likewise.
	* testsuite/std/format/formatter/ext_float.cc: Likewise.
	* testsuite/std/format/formatter/requirements.cc: Likewise.
	* testsuite/std/format/functions/107871.cc: Likewise.
	* testsuite/std/format/functions/format.cc: Likewise.
	* testsuite/std/format/functions/format_to.cc: Likewise.
	* testsuite/std/format/functions/format_to_n.cc: Likewise.
	* testsuite/std/format/functions/size.cc: Likewise.
	* testsuite/std/format/functions/vformat_to.cc: Likewise.
	* testsuite/std/format/parse_ctx.cc: Likewise.
	* testsuite/std/format/string.cc: Likewise.
	* testsuite/std/format/string_neg.cc: Likewise.
	* testsuite/std/format/functions/format_c++23.cc: Removed.
2023-09-15 21:57:39 +01:00
Jonathan Wakely
7dbb691309 libstdc++: Remove dg-options "-std=gnu++2a" from constrained algo tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/function_objects/range.cmp/equal_to.cc:
	Remove dg-options.
	* testsuite/20_util/function_objects/range.cmp/greater.cc:
	Likewise.
	* testsuite/20_util/function_objects/range.cmp/greater_equal.cc:
	Likewise.
	* testsuite/20_util/function_objects/range.cmp/less.cc:
	Likewise.
	* testsuite/20_util/function_objects/range.cmp/less_equal.cc:
	Likewise.
	* testsuite/20_util/function_objects/range.cmp/lwg3530.cc:
	Likewise.
	* testsuite/20_util/function_objects/range.cmp/not_equal_to.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/construct_at/1.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/construct_at/92878_92947.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/construct_at/95788.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/destroy/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/94017.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/94017.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/adjacent_find/constexpr.cc: Likewise.
	* testsuite/25_algorithms/adjacent_find/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/all_of/constexpr.cc: Likewise.
	* testsuite/25_algorithms/all_of/constrained.cc: Likewise.
	* testsuite/25_algorithms/any_of/constexpr.cc: Likewise.
	* testsuite/25_algorithms/any_of/constrained.cc: Likewise.
	* testsuite/25_algorithms/binary_search/constexpr.cc: Likewise.
	* testsuite/25_algorithms/binary_search/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/clamp/constrained.cc: Likewise.
	* testsuite/25_algorithms/constexpr_macro.cc: Likewise.
	* testsuite/25_algorithms/copy/95578.cc: Likewise.
	* testsuite/25_algorithms/copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Likewise.
	* testsuite/25_algorithms/copy_backward/95578.cc: Likewise.
	* testsuite/25_algorithms/copy_backward/constexpr.cc: Likewise.
	* testsuite/25_algorithms/copy_backward/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc:
	Likewise.
	* testsuite/25_algorithms/copy_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/copy_if/constrained.cc: Likewise.
	* testsuite/25_algorithms/copy_n/constexpr.cc: Likewise.
	* testsuite/25_algorithms/copy_n/constrained.cc: Likewise.
	* testsuite/25_algorithms/count/constexpr.cc: Likewise.
	* testsuite/25_algorithms/count/constrained.cc: Likewise.
	* testsuite/25_algorithms/count_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/count_if/constrained.cc: Likewise.
	* testsuite/25_algorithms/cpp_lib_constexpr.cc: Likewise.
	* testsuite/25_algorithms/equal/95578.cc: Likewise.
	* testsuite/25_algorithms/equal/constexpr.cc: Likewise.
	* testsuite/25_algorithms/equal/constexpr_neg.cc: Likewise.
	* testsuite/25_algorithms/equal/constrained.cc: Likewise.
	* testsuite/25_algorithms/equal/debug/constexpr_neg.cc:
	Likewise.
	* testsuite/25_algorithms/equal_range/constexpr.cc: Likewise.
	* testsuite/25_algorithms/equal_range/constrained.cc: Likewise.
	* testsuite/25_algorithms/fill/94017.cc: Likewise.
	* testsuite/25_algorithms/fill/constexpr.cc: Likewise.
	* testsuite/25_algorithms/fill/constrained.cc: Likewise.
	* testsuite/25_algorithms/fill_n/94017.cc: Likewise.
	* testsuite/25_algorithms/fill_n/constexpr.cc: Likewise.
	* testsuite/25_algorithms/fill_n/constrained.cc: Likewise.
	* testsuite/25_algorithms/find/constexpr.cc: Likewise.
	* testsuite/25_algorithms/find/constrained.cc: Likewise.
	* testsuite/25_algorithms/find_end/constexpr.cc: Likewise.
	* testsuite/25_algorithms/find_end/constrained.cc: Likewise.
	* testsuite/25_algorithms/find_first_of/constexpr.cc: Likewise.
	* testsuite/25_algorithms/find_first_of/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/find_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/find_if/constrained.cc: Likewise.
	* testsuite/25_algorithms/find_if_not/constexpr.cc: Likewise.
	* testsuite/25_algorithms/find_if_not/constrained.cc: Likewise.
	* testsuite/25_algorithms/for_each/constexpr.cc: Likewise.
	* testsuite/25_algorithms/for_each/constrained.cc: Likewise.
	* testsuite/25_algorithms/generate/constexpr.cc: Likewise.
	* testsuite/25_algorithms/generate/constrained.cc: Likewise.
	* testsuite/25_algorithms/generate_n/constexpr.cc: Likewise.
	* testsuite/25_algorithms/generate_n/constrained.cc: Likewise.
	* testsuite/25_algorithms/heap/constrained.cc: Likewise.
	* testsuite/25_algorithms/includes/constrained.cc: Likewise.
	* testsuite/25_algorithms/inplace_merge/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/is_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_heap_until/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_partitioned/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_partitioned/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/is_permutation/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_permutation/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/is_sorted/constexpr.cc: Likewise.
	* testsuite/25_algorithms/is_sorted/constrained.cc: Likewise.
	* testsuite/25_algorithms/is_sorted_until/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/is_sorted_until/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/iter_swap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/lexicographical_compare/93972.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare/95578.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare_three_way/1.cc:
	Likewise.
	* testsuite/25_algorithms/lexicographical_compare_three_way/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/lower_bound/constexpr.cc: Likewise.
	* testsuite/25_algorithms/lower_bound/constrained.cc: Likewise.
	* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_neg.cc:
	Likewise.
	* testsuite/25_algorithms/lower_bound/debug/constexpr_partitioned_pred_neg.cc:
	Likewise.
	* testsuite/25_algorithms/lower_bound/debug/constexpr_valid_range_neg.cc:
	Likewise.
	* testsuite/25_algorithms/make_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/max/constrained.cc: Likewise.
	* testsuite/25_algorithms/max_element/constrained.cc: Likewise.
	* testsuite/25_algorithms/merge/constexpr.cc: Likewise.
	* testsuite/25_algorithms/merge/constrained.cc: Likewise.
	* testsuite/25_algorithms/min/constrained.cc: Likewise.
	* testsuite/25_algorithms/min_element/constrained.cc: Likewise.
	* testsuite/25_algorithms/minmax/constrained.cc: Likewise.
	* testsuite/25_algorithms/minmax_element/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/mismatch/constexpr.cc: Likewise.
	* testsuite/25_algorithms/mismatch/constrained.cc: Likewise.
	* testsuite/25_algorithms/move/93872.cc: Likewise.
	* testsuite/25_algorithms/move/95578.cc: Likewise.
	* testsuite/25_algorithms/move/constexpr.cc: Likewise.
	* testsuite/25_algorithms/move/constrained.cc: Likewise.
	* testsuite/25_algorithms/move_backward/93872.cc: Likewise.
	* testsuite/25_algorithms/move_backward/95578.cc: Likewise.
	* testsuite/25_algorithms/move_backward/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/next_permutation/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/next_permutation/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/none_of/constexpr.cc: Likewise.
	* testsuite/25_algorithms/none_of/constrained.cc: Likewise.
	* testsuite/25_algorithms/nth_element/constexpr.cc: Likewise.
	* testsuite/25_algorithms/nth_element/constrained.cc: Likewise.
	* testsuite/25_algorithms/partial_sort/constexpr.cc: Likewise.
	* testsuite/25_algorithms/partial_sort/constrained.cc: Likewise.
	* testsuite/25_algorithms/partial_sort_copy/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/partial_sort_copy/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/partition/constexpr.cc: Likewise.
	* testsuite/25_algorithms/partition/constrained.cc: Likewise.
	* testsuite/25_algorithms/partition_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/partition_copy/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/partition_point/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/partition_point/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/pop_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/prev_permutation/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/prev_permutation/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/push_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/remove/constexpr.cc: Likewise.
	* testsuite/25_algorithms/remove/constrained.cc: Likewise.
	* testsuite/25_algorithms/remove_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/remove_copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/remove_copy_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/remove_copy_if/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/remove_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/remove_if/constrained.cc: Likewise.
	* testsuite/25_algorithms/replace/constrained.cc: Likewise.
	* testsuite/25_algorithms/replace_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/replace_copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/replace_copy_if/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/replace_copy_if/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/replace_if/constexpr.cc: Likewise.
	* testsuite/25_algorithms/replace_if/constrained.cc: Likewise.
	* testsuite/25_algorithms/reverse/constexpr.cc: Likewise.
	* testsuite/25_algorithms/reverse/constrained.cc: Likewise.
	* testsuite/25_algorithms/reverse_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/reverse_copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/rotate/constexpr.cc: Likewise.
	* testsuite/25_algorithms/rotate/constrained.cc: Likewise.
	* testsuite/25_algorithms/rotate_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/rotate_copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/sample/constrained.cc: Likewise.
	* testsuite/25_algorithms/search/constexpr.cc: Likewise.
	* testsuite/25_algorithms/search/constrained.cc: Likewise.
	* testsuite/25_algorithms/search_n/97828.cc: Likewise.
	* testsuite/25_algorithms/search_n/constexpr.cc: Likewise.
	* testsuite/25_algorithms/search_n/constrained.cc: Likewise.
	* testsuite/25_algorithms/set_difference/constexpr.cc: Likewise.
	* testsuite/25_algorithms/set_difference/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/set_intersection/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/set_intersection/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/set_symmetric_difference/constexpr.cc:
	Likewise.
	* testsuite/25_algorithms/set_symmetric_difference/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/set_union/constexpr.cc: Likewise.
	* testsuite/25_algorithms/set_union/constrained.cc: Likewise.
	* testsuite/25_algorithms/shift_left/1.cc: Likewise.
	* testsuite/25_algorithms/shift_right/1.cc: Likewise.
	* testsuite/25_algorithms/shuffle/constrained.cc: Likewise.
	* testsuite/25_algorithms/sort/constexpr.cc: Likewise.
	* testsuite/25_algorithms/sort/constrained.cc: Likewise.
	* testsuite/25_algorithms/sort_heap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/stable_partition/constrained.cc:
	Likewise.
	* testsuite/25_algorithms/stable_sort/constrained.cc: Likewise.
	* testsuite/25_algorithms/swap/constexpr.cc: Likewise.
	* testsuite/25_algorithms/swap_ranges/constexpr.cc: Likewise.
	* testsuite/25_algorithms/swap_ranges/constrained.cc: Likewise.
	* testsuite/25_algorithms/transform/constexpr.cc: Likewise.
	* testsuite/25_algorithms/transform/constrained.cc: Likewise.
	* testsuite/25_algorithms/unique/constexpr.cc: Likewise.
	* testsuite/25_algorithms/unique/constrained.cc: Likewise.
	* testsuite/25_algorithms/unique_copy/constexpr.cc: Likewise.
	* testsuite/25_algorithms/unique_copy/constrained.cc: Likewise.
	* testsuite/25_algorithms/upper_bound/constexpr.cc: Likewise.
	* testsuite/25_algorithms/upper_bound/constrained.cc: Likewise.
	* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_neg.cc:
	Likewise.
	* testsuite/25_algorithms/upper_bound/debug/constexpr_partitioned_pred_neg.cc:
	Likewise.
	* testsuite/25_algorithms/upper_bound/debug/constexpr_valid_range_neg.cc:
	Likewise.
2023-09-15 21:57:39 +01:00
Jonathan Wakely
d4ac20b0af libstdc++: Remove dg-options "-std=gnu++20" from <concepts> and <ranges> tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

libstdc++-v3/ChangeLog:

	* testsuite/std/concepts/1.cc: Remove dg-options.
	* testsuite/std/concepts/2.cc: Likewise.
	* testsuite/std/concepts/concepts.callable/invocable.cc:
	Likewise.
	* testsuite/std/concepts/concepts.callable/regular_invocable.cc:
	Likewise.
	* testsuite/std/concepts/concepts.callable/relation.cc:
	Likewise.
	* testsuite/std/concepts/concepts.callable/strictweakorder.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.arithmetic/floating_point.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.arithmetic/signed_integral.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.arithmetic/unsigned_integral.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.assignable/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.common/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.commonref/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.constructible/1.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.convertible/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.copyconstructible/1.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.defaultinitializable/1.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.defaultinitializable/lwg3149.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.derived/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.destructible/1.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.moveconstructible/1.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.same/1.cc:
	Likewise.
	* testsuite/std/concepts/concepts.lang/concept.swappable/swap.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.swappable/swappable.cc: Likewise.
	* testsuite/std/concepts/concepts.lang/concept.swappable/swappable_with.cc: Likewise.
	* testsuite/std/concepts/concepts.object/copyable.cc: Likewise.
	* testsuite/std/concepts/concepts.object/movable.cc: Likewise.
	* testsuite/std/concepts/concepts.object/regular.cc: Likewise.
	* testsuite/std/concepts/concepts.object/semiregular.cc:
	Likewise.
	* testsuite/std/ranges/97600.cc: Likewise.
	* testsuite/std/ranges/access/101782.cc: Likewise.
	* testsuite/std/ranges/access/begin.cc: Likewise.
	* testsuite/std/ranges/access/begin_neg.cc: Likewise.
	* testsuite/std/ranges/access/cbegin.cc: Likewise.
	* testsuite/std/ranges/access/cdata.cc: Likewise.
	* testsuite/std/ranges/access/cend.cc: Likewise.
	* testsuite/std/ranges/access/crbegin.cc: Likewise.
	* testsuite/std/ranges/access/crend.cc: Likewise.
	* testsuite/std/ranges/access/data.cc: Likewise.
	* testsuite/std/ranges/access/empty.cc: Likewise.
	* testsuite/std/ranges/access/end.cc: Likewise.
	* testsuite/std/ranges/access/end_neg.cc: Likewise.
	* testsuite/std/ranges/access/lwg3467.cc: Likewise.
	* testsuite/std/ranges/access/p2602.cc: Likewise.
	* testsuite/std/ranges/access/rbegin.cc: Likewise.
	* testsuite/std/ranges/access/rend.cc: Likewise.
	* testsuite/std/ranges/access/size.cc: Likewise.
	* testsuite/std/ranges/access/size_neg.cc: Likewise.
	* testsuite/std/ranges/access/ssize.cc: Likewise.
	* testsuite/std/ranges/adaptors/100479.cc: Likewise.
	* testsuite/std/ranges/adaptors/100577.cc: Likewise.
	* testsuite/std/ranges/adaptors/93978.cc: Likewise.
	* testsuite/std/ranges/adaptors/95322.cc: Likewise.
	* testsuite/std/ranges/adaptors/99433.cc: Likewise.
	* testsuite/std/ranges/adaptors/all.cc: Likewise.
	* testsuite/std/ranges/adaptors/common.cc: Likewise.
	* testsuite/std/ranges/adaptors/conditionally_borrowed.cc:
	Likewise.
	* testsuite/std/ranges/adaptors/counted.cc: Likewise.
	* testsuite/std/ranges/adaptors/detail/copyable_box.cc:
	Likewise.
	* testsuite/std/ranges/adaptors/drop.cc: Likewise.
	* testsuite/std/ranges/adaptors/drop_while.cc: Likewise.
	* testsuite/std/ranges/adaptors/elements.cc: Likewise.
	* testsuite/std/ranges/adaptors/filter.cc: Likewise.
	* testsuite/std/ranges/adaptors/join.cc: Likewise.
	* testsuite/std/ranges/adaptors/lazy_split.cc: Likewise.
	* testsuite/std/ranges/adaptors/lazy_split_neg.cc: Likewise.
	* testsuite/std/ranges/adaptors/lwg3286.cc: Likewise.
	* testsuite/std/ranges/adaptors/lwg3313_neg.cc: Likewise.
	* testsuite/std/ranges/adaptors/lwg3325_neg.cc: Likewise.
	* testsuite/std/ranges/adaptors/lwg3406.cc: Likewise.
	* testsuite/std/ranges/adaptors/p1739.cc: Likewise.
	* testsuite/std/ranges/adaptors/p2281.cc: Likewise.
	* testsuite/std/ranges/adaptors/p2770r0.cc: Likewise.
	* testsuite/std/ranges/adaptors/reverse.cc: Likewise.
	* testsuite/std/ranges/adaptors/sizeof.cc: Likewise.
	* testsuite/std/ranges/adaptors/split.cc: Likewise.
	* testsuite/std/ranges/adaptors/take.cc: Likewise.
	* testsuite/std/ranges/adaptors/take_while.cc: Likewise.
	* testsuite/std/ranges/adaptors/transform.cc: Likewise.
	* testsuite/std/ranges/empty_view.cc: Likewise.
	* testsuite/std/ranges/headers/ranges/synopsis.cc: Likewise.
	* testsuite/std/ranges/iota/difference_type.cc: Likewise.
	* testsuite/std/ranges/iota/iota_view.cc: Likewise.
	* testsuite/std/ranges/iota/iterator.cc: Likewise.
	* testsuite/std/ranges/iota/lwg3292_neg.cc: Likewise.
	* testsuite/std/ranges/iota/max_size_type.cc: Likewise.
	* testsuite/std/ranges/istream_view.cc: Likewise.
	* testsuite/std/ranges/p2259.cc: Likewise.
	* testsuite/std/ranges/p2325.cc: Likewise.
	* testsuite/std/ranges/p2367.cc: Likewise.
	* testsuite/std/ranges/range.cc: Likewise.
	* testsuite/std/ranges/refinements.cc: Likewise.
	* testsuite/std/ranges/safe_range.cc: Likewise.
	* testsuite/std/ranges/safe_range_types.cc: Likewise.
	* testsuite/std/ranges/single_view.cc: Likewise.
	* testsuite/std/ranges/sized.cc: Likewise.
	* testsuite/std/ranges/subrange/1.cc: Likewise.
	* testsuite/std/ranges/subrange/97512.cc: Likewise.
	* testsuite/std/ranges/subrange/constexpr.cc: Likewise.
	* testsuite/std/ranges/subrange/lwg3282_neg.cc: Likewise.
	* testsuite/std/ranges/subrange/lwg3286.cc: Likewise.
	* testsuite/std/ranges/subrange/lwg3433.cc: Likewise.
	* testsuite/std/ranges/subrange/sizeof.cc: Likewise.
	* testsuite/std/ranges/subrange/tuple_like.cc: Likewise.
	* testsuite/std/ranges/view.cc: Likewise.
2023-09-15 21:57:39 +01:00
Jonathan Wakely
5d066729ff libstdc++: Remove dg-options "-std=c++20" from <span> and <cuchar> tests
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well.

There doesn't seem to be any reason they need to use strict -std=c++20
mode, so don't add the { dg-add-options strict_std } directive, just let
them use strict or non-strict modes.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc:
	Remove dg-options.
	* testsuite/23_containers/span/contiguous_range_neg.cc:
	Likewise.
	* testsuite/23_containers/span/everything.cc: Likewise.
2023-09-15 21:57:39 +01:00
Jonathan Wakely
07c602bbbd libstdc++: Replace dg-options "-std=c++20" with dg-add-options strict_std
The testsuite will automatically select C++20 for these tests now, and
removing the hardcoded -std option allows them to be tested for C++23
and C++26 as well. Because they test a problem seen with -std=c++20 add
the new { dg-add-options strict_std } directive so that the test runner
uses -std=c++NN not -std=gnu++NN.

libstdc++-v3/ChangeLog:

	* testsuite/24_iterators/reverse_iterator/100639.cc: Remove
	dg-options and add dg-add-options strict_std.
	* testsuite/std/ranges/iota/93267.cc: Likewise.
	* testsuite/std/ranges/iota/96042.cc: Likewise.
	* testsuite/std/ranges/iota/size.cc: Likewise.
	* testsuite/std/ranges/subrange/96042.cc: Likewise.
2023-09-15 21:57:38 +01:00
Jonathan Wakely
c4bf6e8e8a libstdc++: Replace dg-options "-std=c++17" with dg-add-options strict_std
These tests can (and should) also be run for later standards, so replace
the { dg-options "-std=c++17" } with { dg-add-options strict_std }.

	* testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_cxx17.cc:
	Replace dg-options -std=c++17 with dg-add-options strict_std.
	* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_cxx17.cc:
	Likewise.
2023-09-15 21:57:38 +01:00
Jonathan Wakely
52841fb703 libstdc++: Replace dg-options "-std=c++11" with dg-add-options strict_std
These tests can (and should) also be run for later standards, so replace
the { dg-options "-std=c++11" } with { dg-add-options strict_std } and a
target selector for c++11.

libstdc++-v3/ChangeLog:

	* testsuite/23_containers/deque/48101-2_neg.cc: Replace
	dg-options with target selector.
	* testsuite/23_containers/forward_list/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/list/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/map/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/map/48101_neg.cc: Likewise.
	* testsuite/23_containers/multimap/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
	* testsuite/23_containers/multiset/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/set/48101-2_neg.cc: Likewise.
	* testsuite/23_containers/unordered_map/48101-2_neg.cc:
	Likewise.
	* testsuite/23_containers/unordered_multimap/48101-2_neg.cc:
	Likewise.
	* testsuite/23_containers/unordered_multiset/48101-2_neg.cc:
	Likewise.
	* testsuite/23_containers/unordered_set/48101-2_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/48101-2_neg.cc: Likewise.
2023-09-15 21:57:38 +01:00
Jonathan Wakely
3a0e01f6bb libstdc++: Add support for running tests with multiple -std options
This copies the code from the compiler's gcc/testsuite/lib/g++-dg.exp so
that each test can be run multiple times, with different -std options.
This means that we can remove most { dg-options "-std=gnu++20" }
directives from tests, because the testsuite will automatically select
a set of -std options that includes that version.

Tests that should only run for a specific standard (e.g. ones that use
something like { dg-do run { target c++11_only } }) should still specify
that standard with { dg-options "-std=gnu++11" }, which overrides the
automatic selection. But a dg-options that selects a newer standard than
the default can be removed, because that standard will be selected
automatically based on a selector like { target c++20 } in the dg-do
directive. This will allow those tests to be run for more than just the
one they currently hardcode, so that e.g. std::format tests can be run
for all of C++20, C++23 and C++26. Currently that has to be done by
adding a second test file that uses a different dg-options line.

By default most tests will continue to run with only the default dialect
(currently -std=gnu++17) so that the time to run the entire testsuite is
not increased. We can revisit this later if increasing the testsuite
time (and coverage) is acceptable. Libstdc++ developers can easily
override the defaults to run for multiple versions. To test all
versions, either add 'set v3_std_list { 98 11 14 17 20 23 26 }' to
~/.dejagnurc or define GLIBCXX_TESTSUITE_STDS="98,11,14,17,20,23,26" in
the environment.

This should be more efficient than the current way to test with multple
standards, i.e. --target_board=unix{-std=c++14,-std=c++17,-std=c++20},
because today all tests with an explicit -std option hardcoded in them
get run for each target board variation but using the exact same
hardcoded -std every time. With the new approach you can just use the
default --target_board=unix and set GLIBCXX_TESTSUITE_STDS="14,17,20"
and now a test that has { target c++20 } will only run once (and be
UNSUPPORTED twice), instead of running with identical options three
times.

In order to support ~/.dejagnurc and $DEJAGNU files that need to work
with versions of GCC without this change, a new variable is added to
site.tmp to detect whether v3_std_list is supported. That allows e.g.

if { [info exists v3-use-std-list] } {
  set v3_std_list { 11 17 23 }
  set target_list { "unix{,-m32}" }
} else {
  set target_list { "unix{,-std=gnu++2b,-std=gnu++11,-m32}" }
}

libstdc++-v3/ChangeLog:

	* doc/xml/manual/test.xml: Update documentation on running and
	writing tests.
	* doc/html/manual/test.html: Regenerate.
	* testsuite/Makefile.am: Add v3-use-std-list to site.tmp
	* testsuite/Makefile.in: Regenerate.
	* testsuite/lib/dg-options.exp (add_options_for_strict_std): New
	proc.
	* testsuite/lib/libstdc++.exp (search_for): New utility proc.
	(v3-dg-runtest): New proc to replace dg-runtest.
	* testsuite/libstdc++-dg/conformance.exp: Use v3-dg-runtest.
2023-09-15 21:57:38 +01:00
Jonathan Wakely
038c0afa89 libstdc++: Fix 29_atomics/headers/atomic/types_std_c++2a_neg.cc for C++23
This test fails when run as C++23 because the <bits/stdc++.h> PCH
includes <stdatomic.h> which declares ::memory_order, invalidating the
test's assumptions. Disable PCH so that the test verifies that <atomic>
doesn't declare ::memory_order, as originally intended.

Also fix the using-declaration which would be invalid even if the type
was declared in the global namespace, and adjust the expected error.

libstdc++-v3/ChangeLog:

	* testsuite/29_atomics/headers/atomic/types_std_c++2a_neg.cc:
	Fix test to work for C++23 and C++26 too.
2023-09-15 21:57:38 +01:00
Fei Gao
d7b6020276 fix PR 111259 invalid zcmp mov predicate.
The code changes are from Palmer.

root cause:
In a gcc build with --enable-checking=yes, REGNO (op) checks
rtx code and expected code 'reg'. so a rtx with 'subreg' causes
an internal compiler error.

solution:
Restrict predicate to allow 'reg' only.

gcc/ChangeLog:

	* config/riscv/predicates.md: Restrict predicate
	to allow 'reg' only.
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-09-15 13:43:10 -07:00
Patrick Palka
fd5a858eb5 libstdc++: Use C++20 constraints in <bit>
Using a type-constraint instead of enable_if_t in the return types of
these functions greatly reduces the size of their mangled names.  And by
now it's probably safe to assume recent compilers have sufficient C++20
concepts support to handle such constraints.

libstdc++-v3/ChangeLog:

	* include/std/bit: Include <concepts>.
	(byteswap): Use a type-constraint instead of enable_if_t
	inside the return type, and use std::integral.
	(_If_is_unsigned_integer): Replace with ...
	(__unsigned_integer): ... this.
	(rotl): Use a type-constraint instead of enable_if_t inside
	the return type.
	(countl_zero): Likewise.
	(countl_one): Likewise.
	(countr_zero): Likewise.
	(countr_one): Likewise.
	(popcount): Likewise.
	(has_single_bit): Likewise.
	(bit_ceil): Likewise.
	(bit_floor): Likewise.
	(bit_width): Likewise.
2023-09-15 15:26:26 -04:00
David Malcolm
b09193fb06 analyzer: support diagnostics that don't have a stmt
gcc/analyzer/ChangeLog:
	* analyzer.cc (get_stmt_location): Handle null stmt.
	* diagnostic-manager.cc (saved_diagnostic::saved_diagnostic): Copy
	m_loc from ploc.
	(saved_diagnostic::operator==): Compare m_loc.
	(saved_diagnostic::calc_best_epath): Only use m_stmt_finder if
	m_loc is unknown.
	(dedupe_key::dedupe_key): Initialize m_loc.
	(dedupe_key::operator==): Compare m_loc.
	(dedupe_key::get_location): Use m_loc if it's known.
	(dedupe_key::m_loc): New field.
	(diagnostic_manager::emit_saved_diagnostic): Only call
	get_emission_location if m_loc is unknown, preferring to use m_loc
	if it's available.
	* diagnostic-manager.h (saved_diagnostic::m_loc): New field.
	(pending_location::pending_location): Initialize m_loc.  Add
	overload taking a location_t rather than a stmt/stmt_finder.
	(pending_location::m_loc): New field.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-09-15 13:47:42 -04:00
David Malcolm
759a1a52ea analyzer: introduce pending_location
No functional change intended.

gcc/analyzer/ChangeLog:
	* analyzer.h (struct pending_location): New forward decl.
	* diagnostic-manager.cc (saved_diagnostic::saved_diagnostic):
	Replace params "enode", "snode", "stmt", and "stmt_finder" with
	"ploc".
	(diagnostic_manager::add_diagnostic): Likewise for both overloads.
	* diagnostic-manager.h (saved_diagnostic::saved_diagnostic):
	Likewise.
	(struct pending_location): New.
	(diagnostic_manager::add_diagnostic): Replace params "enode",
	"snode", "stmt", and "stmt_finder" with "ploc".
	* engine.cc (impl_region_model_context::warn): Update call to
	add_diagnostic for above change.
	(impl_sm_context::warn): Likewise.
	(impl_region_model_context::on_state_leak): Likewise.
	* infinite-recursion.cc
	(exploded_graph::detect_infinite_recursion): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-09-15 13:47:42 -04:00
David Malcolm
6319b5b2d4 analyzer: handle volatile ops
gcc/analyzer/ChangeLog:
	* region-model.cc (region_model::get_gassign_result): Handle
	volatile ops by using a conjured_svalue.

gcc/testsuite/ChangeLog:
	* c-c++-common/analyzer/volatile-1.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-09-15 13:47:42 -04:00
Harald Anlauf
1cbf18978a Fortran: improve bounds-checking for array sections [PR30802]
gcc/fortran/ChangeLog:

	PR fortran/30802
	* trans-array.cc (trans_array_bound_check): Add optional argument
	COMPNAME for explicit specification of array component name.
	(array_bound_check_elemental): Helper function for generating
	bounds-checking code for elemental dimensions.
	(gfc_conv_expr_descriptor): Use bounds-checking also for elemental
	dimensions, i.e. those not handled by the scalarizer.

gcc/testsuite/ChangeLog:

	PR fortran/30802
	* gfortran.dg/bounds_check_fail_6.f90: New test.
2023-09-15 19:13:38 +02:00
Andrew Pinski
b975c0dc3b MATCH: Improve zero_one_valued_p for cases without range information
I noticed we sometimes lose range information in forwprop due to a few
match and simplify patterns optimizing away casts. So the easier way
to these cases is to add a match for zero_one_valued_p wich mathes
a cast from another zero_one_valued_p.
This also adds the case of `x & zero_one_valued_p` as being zero_one_valued_p
which allows catching more cases too.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

	* match.pd (zero_one_valued_p): Match a cast from a zero_one_valued_p.
	Also match `a & zero_one_valued_p` too.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/bool-13.c: Update testcase as we now do
	the MIN/MAX during forwprop1.
2023-09-15 07:27:12 -07:00
Andrew Pinski
ba4c1f2bfc MATCH: Fix (1 >> X) != 0 pattern for vector types
I had missed that integer_onep can match vector types with uniform constant of `1`.
This means the shifter could be an scalar type and then doing a comparison against `0`
would be an invalid transformation.
This fixes the problem by adding a check for the type of the integer_onep to make
sure it is a INTEGRAL_TYPE_P (which does not match a vector type).

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

	PR tree-optimization/111414

gcc/ChangeLog:

	* match.pd (`(1 >> X) != 0`): Check to see if
	the integer_onep was an integral type (not a vector type).

gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/pr111414-1.c: New test.
2023-09-15 07:27:12 -07:00
Andrew MacLeod
76a2d56784 Always do PHI analysis and before loop analysis.
PHI analysis wasn't being done if loop analysis found a value.  Always
do the PHI analysis, and run it for an iniital value before invoking
loop analysis.

	* gimple-range-fold.cc (fold_using_range::range_of_phi): Always
	run phi analysis, and do it before loop analysis.
2023-09-15 10:08:25 -04:00
Andrew MacLeod
c43bd879b4 Fix indentation.
No functio0nal change, indentation was incorrect.

	* gimple-range-fold.cc (fold_using_range::range_of_phi): Fix
	indentation.
2023-09-15 10:08:25 -04:00
Qing Zhao
4aca1cfd62 Fix PR111407--SSA corruption due to widening_mul opt on conflict across an abnormal edge
This is a bug in tree-ssa-math-opts.cc, when applying the widening mul
optimization, the compiler needs to check whether the operand is in a
ABNORMAL PHI, if YES, we should avoid the transformation.

	PR tree-optimization/111407

gcc/ChangeLog:

	* tree-ssa-math-opts.cc (convert_mult_to_widen): Avoid the transform
	when one of the operands is subject to abnormal coalescing.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr111407.c: New test.
2023-09-15 13:46:52 +00:00
Eric Botcazou
540a1d936d ada: Fix minor glitch in finish_record_type
The size needs to be rounded up to the storage unit in all cases.

gcc/ada/

	* gcc-interface/utils.cc (finish_record_type): Round the size in
	the padding case as well.
2023-09-15 15:01:31 +02:00
Piotr Trojanek
d9275e8781 ada: Explicitly analyze and expand null array aggregates
Null array aggregates have present but empty lists of expressions and
component associations. This confuses the previous code for ordinary
array aggregates, which assumes that if a list of either expressions or
component associations is present, then it is non-empty.

This patch adds explicit handling for null array aggregates to avoid
assertion failures in code for ordinary array aggregates.

gcc/ada/

	* exp_aggr.adb (Build_Array_Aggr_Code): Don't build aggregate code
	for null array aggregates.
	* sem_aggr.adb (Resolve_Array_Aggregate): Don't examine formatting
	of a null array aggregate.
2023-09-15 15:01:30 +02:00
Eric Botcazou
b96446e0d0 ada: Fix wrong optimization of extended return for discriminated record type
This happens when the discriminants of the record type have default values.

gcc/ada/ChangeLog:

	* inline.adb (Expand_Inlined_Call): In the case of a function call
	that returns an unconstrained type and initializes an object, set
	the No_Initialization flag on the new declaration of the object.
2023-09-15 15:01:30 +02:00
Patrick Bernardi
2578936b34 ada: Do not perform local-exception-to-goto optimization on barrier functions
The local-exception-to-goto optimization is no longer applied to entry
barrier functions as entry barriers cannot contain exception handlers and
this optimization interferes with another optimization that occurs for
simple barrier functions.

In particular, the simple barrier optimization removes the push error label
statements generated by the local-exception-to-goto optimization. This
causes a Storage_Error in GIGI when the restriction No_Exception_Propagation
is  active and a protected object contains more than one simple entry
barrier.

gcc/ada/

	* exp_ch6.adb (Expand_N_Subprogram_Body): Do not perform
	local-exception-to- goto optimization on barrier functions.
	* exp_ch9.adb (Expand_Entry_Barrier): Simplify the if statement
	around the simple barrier optimization and remove an old, no
	longer relevant comment.
2023-09-15 15:01:30 +02:00
Patrick Bernardi
62e170e586 ada: Generate runtime restrictions list when the standard library is suppressed
With the introduction of Jorvik support into the light-tasking runtime comes
the requirement to detect voliations of runtime restrictions (for example
Max_Entry_Queue_Length) where previously they could be hard coded in the
runtime. This means we now need the binder to populate
System.System.Restrictions.Run_Time_Restrictions when the standard library
is suppressed.

gcc/ada/

	* bindgen.adb (Gen_Adainit): Generate restrictions when standard
	library is suppressed.
	(Gen_Output_File_Ada): Ditto.
	(Gen_Restrictions): Ditto.
2023-09-15 15:01:30 +02:00
Eric Botcazou
140e20f697 ada: Fix internal error on misaligned component with variable nominal size
The back-end cannot handle this kind of components even when they are small.

gcc/ada/

	* exp_util.adb (Component_May_Be_Bit_Aligned): Do not return false
	for a small component of a record type with a variant part.
2023-09-15 15:01:30 +02:00
Eric Botcazou
ab246c16ee ada: Fix internal error on aggregate nested in container aggregate
This handles the case where a component association is present.

gcc/ada/

	* exp_aggr.adb (Convert_To_Assignments): In the case of a
	component association, call Is_Container_Aggregate on the parent's
	parent.
	(Expand_Array_Aggregate): Likewise.
2023-09-15 15:01:30 +02:00
Kévin Le Gouguec
ee88062cc7 ada: Remove GNAT Pro details regarding mold
gcc/ada/

	* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove
	extended discussion regarding mold run-time dependencies;
	packaging changes in GNAT Pro have made them obsolete.
2023-09-15 15:01:30 +02:00
Eric Botcazou
ef49cc3890 ada: Fix internal error on expression function with Refined_Post aspect
This occurs when the expression function calls a protected function and the
-gnata switch is specified, because the compiler wrongly freezes the called
function when analyzing the expression function, a fallout of the wrapping
scheme used for the Post and Refined_Post aspects.

gcc/ada/

	* sem_res.adb (Resolve_Call): When the target is an entity, do not
	freeze it if the current scope is the inner wrapper function built
	for an expression function with a Post or Refined_Post aspect.
2023-09-15 15:01:29 +02:00
Bob Duff
553c37bedc ada: Clean up scope depth and related code (tech debt)
The main point of this patch is to remove the special case
for Atree.F_Scope_Depth_Value in the Assert that Field_Present
in Get_Field_Value. Pulling on that thread leads to lots
of related cleanup.

gcc/ada/ChangeLog:

	* atree.adb (Node_Kind_Table): Specify parameter explicitly in
	GNAT.Table instantiations. Use fully qualified references instead
	of relying on use clauses.
	(Get_Field_Value): Remove special case for F_Scope_Depth_Value.
	That is, enable the Field_Present check in that case.
	(It was already enabled for all other fields.) Violations of this
	check were already fixed.
	(Print_Node_Statistics): Sort the output in decreasing order of
	frequencies.
	(Print_Field_Statistics): Likewise (sort).
	* accessibility.adb (Accessibility_Level): Pass Allow_Alt_Model in
	recursive calls. Apparently, an oversight.
	(Innermost_Master_Scope_Depth): Need to special-case the 'Old
	attribute and allocators.
	* einfo-utils.ads (Scope_Depth): Use Scope_Kind_Id to get
	predicate checks.
	(Scope_Depth_Set): Likewise.
	(Scope_Depth_Default_0): Likewise.
	* einfo-utils.adb: As for spec.
	* frontend.adb (Frontend): Remove unnecessary "return;".
	* gen_il-types.ads (Scope_Kind): New union type.
	* gen_il-gen-gen_entities.adb (Scope_Kind): New union type.
	* sem.ads: Move "with Einfo.Entities;" from body to spec.
	(Scope_Stack_Entry): Declare Entity to be of Scope_Kind_Id to get
	predicate checks. We had previously been putting non-scopes on the
	scope stack; this prevents such anomalies.
	* sem.adb: Move "with Einfo.Entities;" from body to spec.
	* sem_ch8.ads: Move "with Einfo.Entities;" from body to spec. Add
	"with Types;".
	(Push_Scope): Use Scope_Kind_Id to get predicate checks.
	* sem_ch8.adb: Move "with Einfo.Entities;" from body to spec. Add
	"with Types;".
	(Push_Scope): Use Scope_Kind_Id to get predicate checks.
	(Pop_Scope): Use Scope_Kind_Id on popped entity to get predicate
	checks. This prevents anomalies where a scope pushed onto the
	stack is later mutated to a nonscope before being popped.
	* sem_util.ads (Find_Enclosing_Scope): Add postcondition to ensure
	that the enclosing scope of a node N is not the same node N.
	Clearly, N does not enclose itself.
	* sem_util.adb (Find_Enclosing_Scope): There were several bugs
	where Find_Enclosing_Scope(N) = N. For example, if N is an entity,
	then we would typically go up to its declaration, and then back
	down to the Defining_Entity of the declaration, which is N itself.
	There were other cases where Find_Enclosing_Scope of an entity
	disagreed with Scope. Clearly, Find_Enclosing_Scope and Scope
	should agree (when both are defined). Such bugs caused latent bugs
	in accessibility.adb related to 'Old, and fixing bugs here caused
	such bugs to be revealed. These are fixed by calling Scope when N
	is an entity.

Co-authored-by: Ronan Desplanques <desplanques@adacore.com>
2023-09-15 15:01:29 +02:00
Javier Miranda
545af80aef ada: Crash on creation of extra formals on type extension
Revert previous patch and fix the pending issue.

gcc/ada/

	* accessibility.ads (Needs_Result_Accessibility_Extra_Formal):
	Removed.
	* accessibility.adb (Needs_Result_Accessibility_Level_Param):
	Removed.
	(Needs_Result_Accessibility_Extra_Formal): Removed.
	(Needs_Result_Accessibility_Level): Revert previous patch.
	* sem_ch6.adb (Parent_Subprogram): Handle function overriding an
	enumeration literal.
	(Create_Extra_Formals): Ensure that the parent subprogram has all
	its extra formals.
2023-09-15 15:01:29 +02:00
Lehua Ding
dd6e5d29cb RISC-V: Fix using wrong mode to get reduction insn vlmax
This patch fix using wrong mode when emit vlmax reduction insn. We should
use src operand instead dest operand (which always LMUL=m1) to get the vlmax
length. This patch alse remove dest_mode and mask_mode from insn_expander
constructor, which can be geted by insn_flags.

gcc/ChangeLog:

	* config/riscv/riscv-protos.h (enum insn_flags): Change name.
	(enum insn_type): Ditto.
	* config/riscv/riscv-v.cc (get_mask_mode_from_insn_flags): Removed.
	(emit_vlmax_insn): Adjust.
	(emit_nonvlmax_insn): Adjust.
	(emit_vlmax_insn_lra): Adjust.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/vsetvl/wredsum_vlmax.c: New test.
2023-09-15 20:59:14 +08:00
Mikael Morin
e6dba708c8 fortran: Remove reference count update [PR108957]
Remove one reference count incrementation following the assignment of a
symbol pointer to a local variable.  Most symbol pointers are "weak" pointer
and don't need any reference count update when they are assigned, and it is
especially the case of local variables.

This fixes a memory leak with the testcase from the PR (not included).

	PR fortran/108957

gcc/fortran/ChangeLog:

	* gfortran.h (gfc_symbol): Add comment documenting reference counting.
	* parse.cc (parse_interface): Remove reference count incrementation.
2023-09-15 13:43:43 +02:00
Juzhe-Zhong
b259284ee1 test: Block SLP check of slp-35.c for vect_strided5
gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-35.c: Block SLP check for vect_strided5 targets.
2023-09-15 19:11:35 +08:00
Juzhe-Zhong
5c7c359c90 test: Block SLP check of slp-34.c for vect_strided5
Since RISC-V use vsseg5 which is the vect_store_lanes with stride 5
if failed on RISC-V.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-34.c: Block check for vect_strided5.
2023-09-15 19:10:37 +08:00
Juzhe-Zhong
16c5d0f0c4 test: Block vect_strided5 for slp-34-big-array.c SLP check
If failed on RISC-V since it use vect_store_lanes with array 5.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-34-big-array.c: Block SLP check for vect_strided5.
2023-09-15 19:09:37 +08:00
Juzhe-Zhong
9b80311cdc test: Block slp-16.c check for target support vect_strided6
This testcase FAIL in RISC-V because RISC-V support vect_load_lanes with 6.
FAIL: gcc.dg/vect/slp-16.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorizing stmts using SLP" 2
FAIL: gcc.dg/vect/slp-16.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2

Since it use vlseg6 (vect_load_lanes with array size = 6)

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-16.c: Block vect_strided6.
	* lib/target-supports.exp: Add strided type.
2023-09-15 19:08:30 +08:00
Juzhe-Zhong
0854ebea63 test: Isolate slp-1.c check of target supports vect_strided5
This test failed in RISC-V:
FAIL: gcc.dg/vect/slp-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorizing stmts using SLP" 4
FAIL: gcc.dg/vect/slp-1.c scan-tree-dump-times vect "vectorizing stmts using SLP" 4

Because this loop:
  /* SLP with unrolling by 8.  */
  for (i = 0; i < N; i++)
    {
      out[i*5] = 8;
      out[i*5 + 1] = 7;
      out[i*5 + 2] = 81;
      out[i*5 + 3] = 28;
      out[i*5 + 4] = 18;
    }

is using vect_load_lanes with array size = 5.
instead of SLP.

When we adjust the COST of LANES load store, then it will use SLP.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/slp-1.c: Add vect_stried5.
2023-09-15 19:07:02 +08:00
Juzhe-Zhong
e1ec05b800 test: Remove XPASS for RISCV
Like ARM SVE, this test cause FAILs of XPASS:
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 72)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 77)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 note (test for warnings, line 68)

on RISC-V

gcc/testsuite/ChangeLog:

	* gcc.dg/Wstringop-overflow-47.c: Add riscv.
2023-09-15 19:05:34 +08:00
Lehua Ding
e6413b5dc5 RISC-V: Refactor expand_reduction and cleanup enum reduction_type
This patch refactors expand_reduction, remove the reduction_type argument
and add insn_flags argument to determine the passing of the operands.
ops has also been modified to restrict it to only two cases and to remove
operand that are not in use.

gcc/ChangeLog:

	* config/riscv/autovec-opt.md: Adjust.
	* config/riscv/autovec.md: Ditto.
	* config/riscv/riscv-protos.h (enum class): Delete enum reduction_type.
	(expand_reduction): Adjust expand_reduction prototype.
	* config/riscv/riscv-v.cc (need_mask_operand_p): New helper function.
	(expand_reduction): Refactor expand_reduction.
2023-09-15 18:18:52 +08:00
Jonathan Wakely
5daeda573c libstdc++: Fix constraints for std::variant default constructor
The standard says the default ctor should be constrained, not deleted.
Our use of a defaulted default ctor and _Enable_default_constructor base
class results in it being deleted.

libstdc++-v3/ChangeLog:

	* include/std/variant (variant): Remove derivation from
	_Enable_default_constructor base class.
	(variant::variant()): Constrain.
	* testsuite/20_util/variant/default_ctor.cc: New test.
2023-09-15 10:24:01 +01:00
Jonathan Wakely
d19bdf8874 libstdc++: Remove non-void static assertions in variant's std::get [PR111172]
A void template argument would cause a substitution failure when trying
to form a reference for the return type, so the function body would
never be instantiated.

libstdc++-v3/ChangeLog:

	PR libstdc++/111172
	* include/std/variant (get<T>): Remove !is_void static
	assertions.
2023-09-15 10:24:01 +01:00
Jonathan Wakely
8fa1430bb2 libstdc++: Add operator bool to <charconv> result types (P2497R0)
C++26 adds these convenience conversions.

libstdc++-v3/ChangeLog:

	* include/bits/version.def (to_chars): Define new value for
	C++26.
	* include/bits/version.h: Regenerate.
	* include/std/charconv (to_chars_result::operator bool): New
	function.
	(from_chars_result::operator bool): New function.
	* testsuite/20_util/to_chars/version.cc: Update expected value.
	* testsuite/20_util/from_chars/result.cc: New test.
	* testsuite/20_util/to_chars/result.cc: New test.
2023-09-15 10:24:01 +01:00
Richard Sandiford
2d38f45bcc aarch64: Fix loose ldpstp check [PR111411]
aarch64_operands_ok_for_ldpstp contained the code:

  /* One of the memory accesses must be a mempair operand.
     If it is not the first one, they need to be swapped by the
     peephole.  */
  if (!aarch64_mem_pair_operand (mem_1, GET_MODE (mem_1))
       && !aarch64_mem_pair_operand (mem_2, GET_MODE (mem_2)))
    return false;

But the requirement isn't just that one of the accesses must be a
valid mempair operand.  It's that the lower access must be, since
that's the access that will be used for the instruction operand.

gcc/
	PR target/111411
	* config/aarch64/aarch64.cc (aarch64_operands_ok_for_ldpstp): Require
	the lower memory access to a mem-pair operand.

gcc/testsuite/
	PR target/111411
	* gcc.dg/rtl/aarch64/pr111411.c: New test.
2023-09-15 09:19:14 +01:00
Yang Yujie
227b18f5d7 LoongArch: Reimplement multilib build option handling.
Library build options from --with-multilib-list used to be processed with
*self_spec, which missed the driver's initial canonicalization.  This
caused limitations on CFLAGS override and the use of driver-only options
like -m[no]-lsx.

The problem is solved by promoting the injection rules of --with-multilib-list
options to the first element of DRIVER_SELF_SPECS, to make them execute before
the canonialization.  The library-build options are also hard-coded in
the driver and can be used conveniently by the builders of other non-gcc
libraries via the use of -fmultiflags.

Bootstrapped and tested on loongarch64-linux-gnu.

ChangeLog:

	* config-ml.in: Remove unneeded loongarch clause.
	* configure.ac: Register custom makefile fragments mt-loongarch-*
	for loongarch targets.
	* configure: Regenerate.

config/ChangeLog:

	* mt-loongarch-mlib: New file.  Pass -fmultiflags when building
	target libraries (FLAGS_FOR_TARGET).
	* mt-loongarch-elf: New file.
	* mt-loongarch-gnu: New file.

gcc/ChangeLog:

	* config.gcc: Pass the default ABI via TM_MULTILIB_CONFIG.
	* config/loongarch/loongarch-driver.h: Invoke MLIB_SELF_SPECS
	before the driver canonicalization routines.
	* config/loongarch/loongarch.h: Move definitions of CC1_SPEC etc.
	to loongarch-driver.h
	* config/loongarch/t-linux: Move multilib-related definitions to
	t-multilib.
	* config/loongarch/t-multilib: New file.  Inject library build
	options obtained from --with-multilib-list.
	* config/loongarch/t-loongarch: Same.
2023-09-15 10:42:12 +08:00
Lehua Ding
68cb873fd3 RISC-V: Support combine extend and reduce sum to widen reduce sum
This patch add combine pattern to combine extend and reduce sum
to widen reduce sum. The pattern in autovec.md was adjusted as
needed. Note that the current vectorization cannot generate reduce
operand which is LMUL=M8, because this means that we need an LMUL=M16
for the extended operand, which is currently not possible. So I've
added VI_QHS_NO_M8 and VF_HS_NO_M8 mode iterator, which exclude
mode which is LMUL=M8.

	PR target/111381

gcc/ChangeLog:

	* config/riscv/autovec-opt.md (*reduc_plus_scal_<mode>):
	New combine pattern.
	(*fold_left_widen_plus_<mode>): Ditto.
	(*mask_len_fold_left_widen_plus_<mode>): Ditto.
	* config/riscv/autovec.md (reduc_plus_scal_<mode>):
	Change from define_expand to define_insn_and_split.
	(fold_left_plus_<mode>): Ditto.
	(mask_len_fold_left_plus_<mode>): Ditto.
	* config/riscv/riscv-v.cc (expand_reduction):
	Support widen reduction.
	* config/riscv/vector-iterators.md (UNSPEC_WREDUC_SUM):
	Add new iterators and attrs.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/widen/widen_reduc-1.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order-1.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order-2.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order_run-1.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_reduc_order_run-2.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_reduc_run-1.c: New test.
2023-09-15 09:44:44 +08:00