- Mar 27, 2024
-
-
GCC Administrator authored
-
- Mar 26, 2024
-
-
Arsen Arsenović authored
Per the standard, the return type of a generators ranges iterator op* should be the reference type rather than the yielded type. The yielded type was used here by mistake. libstdc++-v3/ChangeLog: * include/std/generator (generator::_Iterator::operator*): Fix return type. * testsuite/24_iterators/range_generators/iter_deref_return.cc: New test.
-
Arsen Arsenović authored
libstdc++-v3/ChangeLog: * include/std/generator: Fix _V badname.
-
Jonathan Wakely authored
Rmove the dejagnu code for checking whether std::stacktrace is supported and just use the new dg-require-cpp-feature-test directive to check for __cpp_lib_stacktrace instead. libstdc++-v3/ChangeLog: * testsuite/19_diagnostics/stacktrace/current.cc: Check for __cpp_lib_stacktrace instead of check for stacktrace ET. * testsuite/19_diagnostics/stacktrace/entry.cc: Likewise. * testsuite/19_diagnostics/stacktrace/hash.cc: Likewise. * testsuite/19_diagnostics/stacktrace/output.cc: Likewise. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise. * testsuite/19_diagnostics/stacktrace/synopsis.cc: Likewise. * testsuite/19_diagnostics/stacktrace/version.cc: Likewise. * testsuite/23_containers/vector/debug/assign4_backtrace_neg.cc: Likewise. * testsuite/lib/libstdc++.exp (check_effective_target_stacktrace): Remove.
-
Jonathan Wakely authored
This adds a new dejagnu directive which can be used to make a test depend on a feature test macro such as __cpp_lib_text_encoding. This is mroe flexible than writing a new dg-require-xxx for each feature. libstdc++-v3/ChangeLog: * testsuite/lib/dg-options.exp (dg-require-cpp-feature-test): New proc. * testsuite/lib/libstdc++.exp (check_v3_target_cpp_feature_test): New proc. * testsuite/std/text_encoding/cons.cc: Use new directive to skip the test if the __cpp_lib_text_encoding feature test macro is not defined. * testsuite/std/text_encoding/requirements.cc: Likewise.
-
GCC Administrator authored
-
- Mar 25, 2024
-
-
Jonathan Wakely authored
This was a copy & paste error. libstdc++-v3/ChangeLog: * testsuite/std/text_encoding/requirements.cc: #undef the correct macro.
-
- Mar 24, 2024
-
-
GCC Administrator authored
-
- Mar 23, 2024
-
-
Jonathan Wakely authored
This was just approved in Tokyo as a DR for C++23. It doesn't affect us yet, because we don't implement the __cpp_lib_format_ranges features. We can add the disabled specializations and add a testcase now though. libstdc++-v3/ChangeLog: * include/std/format (formatter): Disable specializations that would allow sequences of narrow characters to be formatted as wchar_t without conversion, as per LWG 3944. * testsuite/std/format/formatter/lwg3944.cc: New test.
-
Jonathan Wakely authored
We already have __is_in_place_type_v for in_place_type_t so adding an equivalent for in_place_index_t allows us avoid a class template instantiation for the __not_in_place_tag constraint on the most commonly-used std::variant::variant(T&&) constructor. For in_place_type_t we also have a __is_in_place_type class template defined in terms of the variable template, but that isn't actually used anywhere. I'm not adding an equivalent for the new variable template, because that wouldn't be used either. For GCC 15 we should remove the unused __is_in_place_tag and __is_in_place_type class templates. libstdc++-v3/ChangeLog: * include/bits/utility.h (__is_in_place_index_v): New variable template. * include/std/variant (__not_in_place_tag): Define in terms of variable templates not a class template.
-
Jonathan Wakely authored
The difference between __type_identity_t and std::type_identity_t is observable, as demonstrated in the PR. Nobody in LWG seems to think this an example we should really care about, but it seems easy and harmless to change this. libstdc++-v3/ChangeLog: PR libstdc++/114400 * include/std/string_view (operator==): Use std::type_identity_t in C++20 instead of our own __type_identity_t.
-
GCC Administrator authored
-
- Mar 22, 2024
-
-
Jonathan Wakely authored
The allocator objects in container node handles were not being destroyed after the node was re-inserted into a container. They are stored in a union and so need to be explicitly destroyed when the node becomes empty. The containers were zeroing the node handle's pointer, which makes it empty, causing the handle's destructor to think there's nothign to clean up. Add a new member function to the node handle which destroys the allocator and zeros the pointer. Change the containers to call that instead of just changing the pointer manually. We can also remove the _M_empty member of the union which is not necessary. libstdc++-v3/ChangeLog: PR libstdc++/114401 * include/bits/hashtable.h (_Hashtable::_M_reinsert_node): Call release() on node handle instead of just zeroing its pointer. (_Hashtable::_M_reinsert_node_multi): Likewise. (_Hashtable::_M_merge_unique): Likewise. (_Hashtable::_M_merge_multi): Likewise. * include/bits/node_handle.h (_Node_handle_common::release()): New member function. (_Node_handle_common::_Optional_alloc::_M_empty): Remove unnecessary union member. (_Node_handle_common): Declare _Hashtable as a friend. * include/bits/stl_tree.h (_Rb_tree::_M_reinsert_node_unique): Call release() on node handle instead of just zeroing its pointer. (_Rb_tree::_M_reinsert_node_equal): Likewise. (_Rb_tree::_M_reinsert_node_hint_unique): Likewise. (_Rb_tree::_M_reinsert_node_hint_equal): Likewise. * testsuite/23_containers/multiset/modifiers/114401.cc: New test. * testsuite/23_containers/set/modifiers/114401.cc: New test. * testsuite/23_containers/unordered_multiset/modifiers/114401.cc: New test. * testsuite/23_containers/unordered_set/modifiers/114401.cc: New test.
-
Jonathan Wakely authored
This is needed to avoid errors outside the immediate context when evaluating is_default_constructible_v<vector<T, A>> when A is not default constructible. To avoid diagnostic regressions for 23_containers/vector/48101_neg.cc we need to make the std::allocator<cv T> partial specializations default constructible, which they probably should have been anyway. libstdc++-v3/ChangeLog: PR libstdc++/113841 * include/bits/allocator.h (allocator<cv T>): Add default constructor to partial specializations for cv-qualified types. * include/bits/stl_vector.h (_Vector_impl::_Vector_impl()): Constrain so that it's only present if the allocator is default constructible. * include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()): Likewise. * testsuite/23_containers/vector/cons/113841.cc: New test.
-
Jonathan Wakely authored
The preprocessor checks for __cplusplus in <bits/stl_construct.h> should use the appropriate feature test macros instead of __cplusplus, namely __glibcxx_raw_memory_algorithms and __cpp_constexpr_dynamic_alloc. For the latter, we want to check the compiler macro not the library's __cpp_lib_constexpr_dynamic_alloc, because the latter is not defined for freestanding but std::construct_at needs to be. libstdc++-v3/ChangeLog: * include/bits/stl_construct.h (destroy_at, construct_at): Guard with feature test macros instead of just __cplusplus.
-
Jonathan Wakely authored
Put the C++23 generator and tuple_like ones before the C++26 ones. libstdc++-v3/ChangeLog: * include/bits/version.def (generator, tuple_like): Move earlier in the file. * include/bits/version.h: Regenerate.
-
Jonathan Wakely authored
Replace std::result_of with std::invoke_result, as specified in the standard since C++17, to avoid deprecated warnings for std::result_of. We don't have __invoke_result_t in C++11 mode, so add it as an alias template for __invoke_result<>::type (which is what std::result_of uses as its base class, so there's no change in functionality). This fixes warnings given by Clang 18. libstdc++-v3/ChangeLog: PR libstdc++/114394 * include/std/functional (bind): Use __invoke_result_t instead of result_of::type. * include/std/type_traits (__invoke_result_t): New alias template. * testsuite/20_util/bind/ref_neg.cc: Adjust prune pattern.
-
- Mar 21, 2024
-
-
GCC Administrator authored
-
- Mar 20, 2024
-
-
François Dumont authored
_GLIBCXX_DEBUG has now fully N3344 compliant iterator checks, we can define __cpp_lib_null_iterators macros like the normal mode. libstdc++-v3/ChangeLog: * include/bits/version.def (null_iterators): Remove extra_cond. * include/bits/version.h: Regenerate.
-
GCC Administrator authored
-
- Mar 19, 2024
-
-
Jonathan Wakely authored
The multiplication (4 * _M_t * __1p) can wraparound to zero if _M_t is unsigned and 4 * _M_t wraps to zero. The third operand has type double, so do the second multiplication first, so that we aren't multiplying integers. libstdc++-v3/ChangeLog: PR libstdc++/114359 * include/bits/random.tcc (binomial_distribution::param_type): Ensure arithmetic is done as type double. * testsuite/26_numerics/random/binomial_distribution/114359.cc: New test.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: PR libstdc++/101228 * include/pstl/parallel_backend_tbb.h (TBB_SUPPRESS_DEPRECATED_MESSAGES): Define before including <tbb/task.h> then undef afterwards.
-
Jonathan Wakely authored
This is a generated header but regenerating it requires the manual step of running 'make -C include update-version' in the libstdc++ build dir. Make it regenerate automatically when --enable-maintainer-mode is used. libstdc++-v3/ChangeLog: * include/Makefile.am [MAINTAINER_MODE]: Add target to automatically update <bits/version.h>. * include/Makefile.in: Regenerate. gcc/ChangeLog: * doc/install.texi (Prerequisites): Document use of autogen for libstdc++.
-
Jonathan Wakely authored
There are several more sub-directories below 'src' now, with lots more conveience libraries. Document them all as of GCC 14. Also document how to regenerate the generated headers under include/bits and how to update the tzdata.zi file. libstdc++-v3/ChangeLog: * doc/xml/manual/build_hacking.xml: Document generated files. Update list of convenience libraries and sub-directories under the src directory. * doc/html/*: Regenerate.
-
Jonathan Wakely authored
These scripts both print "generated by $file, do not edit" header but one of them prints the wrong filename. Use the built-in __file__ attribute to ensure it's correct. contrib/ChangeLog: * unicode/gen_libstdcxx_unicode_data.py: Fix header of generated file to name the correct script. libstdc++-v3/ChangeLog: * include/bits/text_encoding-data.h: Regenerate. * include/bits/unicode-data.h: Regenerate. * scripts/gen_text_encoding_data.py: Fix header of generated file to name the correct script.
-
Jonathan Wakely authored
This has been reported upstream. libstdc++-v3/ChangeLog: * testsuite/util/pstl/test_utils.h: Fix typos in comments.
-
Jonathan Wakely authored
This doesn't cause a problem with GCC, but Clang correctly diagnoses a bug in the code. The objects in the allocated storage need to begin their lifetime before we start using them. This change uses the allocator's construct function instead of using std::construct_at directly, in order to support fancy pointers. libstdc++-v3/ChangeLog: PR libstdc++/114367 * include/bits/stl_bvector.h (_M_allocate): Use allocator's construct function to begin lifetime of words.
-
Iain Sandoe authored
For Darwin, in order to allow uninstalled testing, we need to provide a '-B' option pointing to each path containing an uninstalled library that we are using (these get appended to the embedded runpaths). This updates the version of the atomic_link_flags proc in the libstdc++ testsuite to do the same as the one in the GCC testsuite. libstdc++-v3/ChangeLog: * testsuite/lib/dg-options.exp (atomic_link_flags): Emit a -B option for the path to the uninstalled libatomic. Signed-off-by:
Iain Sandoe <iain@sandoe.co.uk>
-
Iain Sandoe authored
Darwin has a separate debug linker, which is invoked when the command line contains source files and debug is enabled. Using /dev/null as the executable name does not, therefore, work when debug is enabled, since the debug linker does not accept /dev/null as a valid executable name. The leads to incorrectly UNSUPPORTED testcases because of the unintended error result from the test compilation. The solution here is to use a temporary file that is deleted at the end of the test (which is the mechanism used elsewhere) libstdc++-v3/ChangeLog: * testsuite/lib/libstdc++.exp (v3_target_compile): Instead of /dev/null, use a temporary file for test executables on Darwin. Signed-off-by:
Iain Sandoe <iain@sandoe.co.uk>
-
GCC Administrator authored
-
- Mar 18, 2024
-
-
François Dumont authored
We shall be able to advance from a 0 offset a value-initialized iterator. libstdc++-v3/ChangeLog: * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_can_advance): Accept 0 offset advance on value-initialized iterator. * testsuite/23_containers/vector/debug/n3644.cc: New test case.
-
François Dumont authored
Unordered container local_iterator range shall not contain any singular iterator unless both iterators are both value-initialized. libstdc++-v3/ChangeLog: * include/debug/safe_local_iterator.tcc (_Safe_local_iterator::_M_valid_range): Add _M_value_initialized and _M_singular checks. * testsuite/23_containers/unordered_set/debug/114316.cc: New test case.
-
GCC Administrator authored
-
- Mar 17, 2024
-
-
François Dumont authored
Consider range of value-initialized iterators as valid and empty. libstdc++-v3/ChangeLog: PR libstdc++/114316 * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_valid_range): First check if both iterators are value-initialized before checking if singular. * testsuite/23_containers/set/debug/114316.cc: New test case. * testsuite/23_containers/vector/debug/114316.cc: New test case.
-
- Mar 15, 2024
-
-
GCC Administrator authored
-
- Mar 14, 2024
-
-
Jonathan Wakely authored
The fast path for "{}" format strings has a bug for negative integers where the length passed to std::to_chars is too long. libstdc++-v3/ChangeLog: PR libstdc++/114325 * include/std/format (_Scanner::_M_scan): Pass correct length to __to_chars_10_impl. * testsuite/std/format/functions/format.cc: Check negative integers with empty format-spec.
-
Jonathan Wakely authored
Add the [[nodiscard]] attribute to several functions in <algorithm>. These all have no side effects and are only called for their return value (e.g. std::count) or produce a result that must not be discarded for correctness (e.g. std::remove). I was intending to add the attribute to a number of other functions like std::copy_if, std::unique_copy, std::set_union, and std::set_difference. I stopped when I noticed that MSVC doesn't use it on those functions, which I suspect is because they're often used with an insert iterator (e.g. std::back_insert_iterator). In that case it doesn't matter if you discard the result, because you have the container to tell you how many elements were copied to the output range. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (find_end, all_of, none_of, any_of) (find_if_not, is_partitioned, partition_point, remove) (remove_if, unique, lower_bound, upper_bound, equal_range) (binary_search, includes, is_sorted, is_sorted_until, minmax) (minmax_element, is_permutation, clamp, find_if, find_first_of) (adjacent_find, count, count_if, search, search_n, min_element) (max_element): Add nodiscard attribute. * include/bits/stl_algobase.h (min, max, lower_bound, equal) (lexicographical_compare, lexicographical_compare_three_way) (mismatch): Likewise. * include/bits/stl_heap.h (is_heap, is_heap_until): Likewise. * testsuite/25_algorithms/equal/debug/1_neg.cc: Add dg-warning. * testsuite/25_algorithms/equal/debug/2_neg.cc: Likewise. * testsuite/25_algorithms/equal/debug/3_neg.cc: Likewise. * testsuite/25_algorithms/find_first_of/concept_check_1.cc: Likewise. * testsuite/25_algorithms/is_permutation/2.cc: Likewise. * testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise. * testsuite/25_algorithms/lower_bound/33613.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/irreflexive.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/partitioned_neg.cc: Likewise. * testsuite/25_algorithms/lower_bound/debug/partitioned_pred_neg.cc: Likewise. * testsuite/25_algorithms/minmax/3.cc: Likewise. * testsuite/25_algorithms/search/78346.cc: Likewise. * testsuite/25_algorithms/search_n/58358.cc: Likewise. * testsuite/25_algorithms/unique/1.cc: Likewise. * testsuite/25_algorithms/unique/11480.cc: Likewise. * testsuite/25_algorithms/upper_bound/33613.cc: Likewise. * testsuite/25_algorithms/upper_bound/debug/partitioned_neg.cc: Likewise. * testsuite/25_algorithms/upper_bound/debug/partitioned_pred_neg.cc: Likewise. * testsuite/ext/concept_checks.cc: Likewise. * testsuite/ext/is_heap/47709.cc: Likewise. * testsuite/ext/is_sorted/cxx0x.cc: Likewise.
-
xndcn authored
For 80-bit long double we need to clear the padding bits on construction. libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (__atomic_float::__atomic_float(Fp)): Clear padding. * testsuite/29_atomics/atomic_float/compare_exchange_padding.cc: New test. Signed-off-by:
xndcn <xndchn@gmail.com> Reviewed-by:
Jonathan Wakely <jwakely@redhat.com>
-
Jonathan Wakely authored
The bug with exceptions thrown during a std::call_once call affects all targets, so fix the docs that say it only affects non-Linux targets. libstdc++-v3/ChangeLog: PR libstdc++/66146 * doc/xml/manual/status_cxx2011.xml: Remove mention of Linux in note about std::call_once. * doc/xml/manual/status_cxx2014.xml: Likewise. * doc/xml/manual/status_cxx2017.xml: Likewise. * doc/html/manual/status.html: Regenerate.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * doc/xml/manual/status_cxx2023.xml: Update C++23 status table. * doc/html/manual/status.html: Regenerate. * include/bits/version.def: Fix typo in comment.
-