Skip to content
Snippets Groups Projects
  1. Aug 18, 2021
    • Jonathan Wakely's avatar
      libstdc++: Improve doxygen documentation for std::unique_ptr · 4fb471af
      Jonathan Wakely authored
      
      Add more detailed documentation for unique_ptr and related components.
      
      The new alias templates for the _MakeUniq SFINAE helper make the
      generated docs look better too.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/unique_ptr.h (default_delete): Add @since tag.
      	(unique_ptr, unique_ptr<T[]>): Likewise. Improve @brief.
      	(make_unique, make_unique_for_overwrite): Likewise. Add @tparam,
      	@param, and @returns.
      	(_MakeUniq): Move to __detail namespace. Add alias template
      	helpers.
      4fb471af
    • Jonathan Wakely's avatar
      libstdc++: Improve doxygen comments in <bits/stl_function.h> · 828176ba
      Jonathan Wakely authored
      
      Add notes about deprecation and modern replacements. Fix bogus
      "memory_adaptors" group name. Use markdown for formatting.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stl_function.h: Improve doxygen comments.
      828176ba
    • Jonathan Wakely's avatar
      libstdc++: Enable doxygen processing for C++20 components · aba938d6
      Jonathan Wakely authored
      
      Improve grouping, add @since and @deprecated information.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* doc/doxygen/user.cfg.in (PREDEFINED): Enable doxygen
      	processing for C++20 components and components that depend on
      	compiler features.
      	* include/bits/stl_algo.h (random_shuffle): Use @deprecated.
      	* include/std/type_traits: Improve doxygen comments for C++20
      	traits.
      aba938d6
    • Jonathan Wakely's avatar
      libstdc++: Simplify n-ary arithmetic promotion traits · 37620d57
      Jonathan Wakely authored
      
      The std::complex partial specializations have been unnecessary since
      774c3d86
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/ext/type_traits.h (__promote_2, __promote_3)
      	(__promote_4): Redfine as alias templates using __promoted_t.
      	* include/std/complex (__promote_2): Remove partial
      	specializations for std::complex.
      37620d57
    • Jonathan Wakely's avatar
      libstdc++: Minor optimization for min/max/minmax · de44eee5
      Jonathan Wakely authored
      
      The debug mode checks for a valid range are redundant when we have an
      initializer_list argument, because we know it's a valid range already.
      By making std::min(initialier_list<T>) call the internal __min_element
      function directly we avoid a function call and skip those checks. The
      same can be done for the overload taking a comparison function, and also
      for the std::max and std::minmax overloads for initializer_list
      arguments.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stl_algo.h (min(initializer_list<T>))
      	(min(initializer_list<T>, Compare)): Call __min_element directly to
      	avoid redundant debug checks for valid ranges.
      	(max(initializer_list<T>), max(initializer_list<T>, Compare)):
      	Likewise, for __max_element.
      	(minmax(initializer_list<T>), minmax(initializer_list<T>, Compare)):
      	Likewise, for __minmax_element.
      de44eee5
    • Jonathan Wakely's avatar
      libstdc++: Fix CTAD for debug sequence containers · 085c2f8f
      Jonathan Wakely authored
      
      This fixes some 23_containers/*/cons/deduction.cc failures seen with
      -std=c++17/-D_GLIBCXX_DEBUG, caused by non-immediate errors when
      substituting template arguments into an incorrect specialization of the
      std::__cxx1998 base class. This happens because the size_type member of
      the debug container is _Base_type::size_type, so is non-deducible, and
      the deduced types get substituted into _Base_type, triggering the
      static_assert that checks the allocator's value_type matches the
      container's.
      
      The solution is to make the C(size_type, const T&, const Alloc&)
      constructors of the debug sequence containers non-deducible. In order to
      make CTAD work again deduction guides that use std::size_t for the first
      argument are added.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/debug/deque (deque(size_type, const T&, const A&)):
      	Prevent class template argument deduction and replace with a
      	deduction guide.
      	* include/debug/forward_list (forward_list(size_type, const T&, const A&)):
      	Likewise.
      	* include/debug/list (list(size_type, const T&, const A&)):
      	Likewise.
      	* include/debug/vector (vector(size_type, const T&, const A&)):
      	Likewise.
      085c2f8f
    • Jonathan Wakely's avatar
      libstdc++: Fix vector<bool> printer tests to work in debug mode · c883d1dc
      Jonathan Wakely authored
      
      This fixes a compilation error in debug mode, due to std::_Bit_reference
      not being defined, because it's in namespace std::__cxx1998 instead. We
      can refer to it as vector<bool>::reference instead, which always works.
      
      That fixes some compilation errors in debug mode, but the tests fail at
      run-time instead because the printers for vector<bool> helpers are only
      registered for the std namespace, not std::__cxx1998. That is fixed by
      using add_container to register the printers instead of add_version, as
      the former registers them in the std and std::__cxx1998 namespaces.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* python/libstdcxx/v6/printers.py (StdBitReferencePrinter): Use
      	'std::vector<bool>::reference' as type name, not _Bit_reference.
      	(build_libstdcxx_dictionary): Register printers for vector<bool>
      	types in debug mode too.
      	* testsuite/libstdc++-prettyprinters/simple.cc: Adjust expected
      	output for invalid _Bit_reference. Use vector<bool>::reference
      	instead of _Bit_reference.
      	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
      c883d1dc
    • GCC Administrator's avatar
      Daily bump. · 2d14d64b
      GCC Administrator authored
      2d14d64b
  2. Aug 17, 2021
  3. Aug 16, 2021
    • Jonathan Wakely's avatar
      libstdc++: Use qualified-id for class member constant [PR101937] · 6c25932a
      Jonathan Wakely authored
      
      The expression ctx._M_indent is not a constant expression when ctx is a
      reference parameter, even though _M_indent is an enumerator. Rename it
      to _S_indent to be consistent with our conventions, and refer to it as
      PrintContext::_S_indent to be valid C++ code (at least until P2280 is
      accepted as a DR).
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/101937
      	* src/c++11/debug.cc (PrintContext::_M_indent): Replace with a
      	static data member.
      	(print_word): Use qualified-id to access it.
      6c25932a
    • Jonathan Wakely's avatar
      libstdc++: Install GDB pretty printers for debug library · db853ff7
      Jonathan Wakely authored
      
      The additional libraries installed by --enable-libstdcxx-debug are built
      without optimization to aid debugging, but the Python pretty printers
      are not installed alongside them. This means that you can step through
      the unoptimized library code, but at the expense of pretty printing the
      library types.
      
      This remedies the situation by installing another copy of the GDB hooks
      alongside the debug version of libstdc++.so.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* python/Makefile.am [GLIBCXX_BUILD_DEBUG] (install-data-local):
      	Install another copy of the GDB hook.
      	* python/Makefile.in: Regenerate.
      db853ff7
  4. Aug 13, 2021
  5. Aug 12, 2021
  6. Aug 11, 2021
    • Jonathan Wakely's avatar
      libstdc++: Fix test that fails randomly [PR101866] · 93f1dbc7
      Jonathan Wakely authored
      This test assumes that the same sequence of three values cannot occur,
      which is incorect. It's unlikely, but not impossible.
      
      Perform the check in a loop, so that in the unlikely event of an
      identical sequence, we retry. If the library code is buggy it will keep
      producing the same sequence and the test will time out. If the code is
      working correctly then we will usually break out of the loop after one
      iteration, or very rarely after two or three.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/101866
      	* testsuite/experimental/random/randint.cc: Loop and retry if
      	reseed() produces the same sequence.
      93f1dbc7
    • Jonathan Wakely's avatar
      libstdc++: Define std::is_pointer_interconvertible_base_of for C++20 · 4fa6c0ec
      Jonathan Wakely authored
      
      Implement these traits using the new built-ins that Jakub added
      recently.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/type_traits (__cpp_lib_is_pointer_interconvertible)
      	(is_pointer_interconvertible_base_of_v)
      	(is_pointer_interconvertible_base_of): Define for C++20.
      	* include/std/version (__cpp_lib_is_pointer_interconvertible):
      	Define.
      	* testsuite/23_containers/span/layout_compat.cc: Use correct
      	feature test macro for std::is_layout_compatible_v.
      	* testsuite/20_util/is_pointer_interconvertible/value.cc: New test.
      	* testsuite/20_util/is_pointer_interconvertible/version.cc: New test.
      4fa6c0ec
    • Jonathan Wakely's avatar
  7. Aug 10, 2021
  8. Aug 09, 2021
    • Jonathan Wakely's avatar
      libstdc++: Reduce use of debug containers in <regex> · f5a2d780
      Jonathan Wakely authored
      
      The std::regex code uses std::map and std::vector, which means that when
      _GLIBCXX_DEBUG is defined it uses the debug versions of those
      containers. That no longer compiles, because I changed <regex> to
      include <bits/stl_map.h> and <bits/stl_vector.h> instead of <map> and
      <vector>, so the debug versions aren't defined, and std::map doesn't
      compile. There is also a use of std::stack, which defaults to std::deque
      which is the debug deque when _GLIBCXX_DEBUG is defined.
      
      Using std::map, std::vector, and std::deque is probably a mistake, and
      we should qualify them with _GLIBCXX_STD_C instead so that the debug
      versions aren't used. We do not need the overhead of checking our own
      uses of those containers, which should be correct anyway. The exception
      is the vector base class of std::match_results, which exposes iterators
      to users, so can benefit from debug mode checks for its iterators. For
      other accesses to the vector elements, match_results already does its
      own checks, so can access the _GLIBCXX_STD_C::vector base class
      directly.
      
      Signed-off-by: default avatarJonathan Wakely <jwakely@redhat.com>
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/regex.h (basic_regex::transform_primary): Use
      	_GLIBCXX_STD_C::vector for local variable.
      	* include/bits/regex.tcc (__regex_algo_impl): Use reference to
      	_GLIBCXX_STD_C::vector base class of match_results.
      	* include/bits/regex_automaton.tcc (_StateSeq:_M_clone): Use
      	_GLIBCXX_STD_C::map and _GLIBCXX_STD_C::deque for local
      	variables.
      	* include/bits/regex_compiler.h (_BracketMatcher): Use
      	_GLIBCXX_STD_C::vector for data members.
      	* include/bits/regex_executor.h (_Executor): Likewise.
      	* include/std/regex [_GLIBCXX_DEBUG]: Include <debug/vector>.
      f5a2d780
    • François Dumont's avatar
      libstdc++: [_GLIBCXX_DEBUG] Avoid allocator operator== when always equal · 1354603b
      François Dumont authored
      Use std::allocator_traits::is_always_equal to find out if we need to compare
      allocator instances on safe container allocator aware move constructor.
      
      libstdc++-v3/ChangeLog:
      
      	* include/debug/safe_container.h
      	(_Safe_container(_Safe_container&&, const _Alloc&, std::true_type)): New.
      	(_Safe_container(_Safe_container&&, const _Alloc&, std::false_type)): New.
      	(_Safe_container(_Safe_container&&, const _Alloc&)): Use latters.
      1354603b
    • Jonathan Wakely's avatar
      libstdc++: Make allocator equality comparable in tests · 2eff2a3c
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* testsuite/23_containers/unordered_map/cons/default.cc: Add
      	equality comparison operators to allocator.
      	* testsuite/23_containers/unordered_set/cons/default.cc:
      	Likewise.
      2eff2a3c
    • GCC Administrator's avatar
      Daily bump. · 844105d9
      GCC Administrator authored
      844105d9
  9. Aug 08, 2021
    • François Dumont's avatar
      libstdc++: Fix dg-prune-output assertion message · ad9c3941
      François Dumont authored
      Since __glibcxx_assert changes in r6b42b5a the generated assertion message
      has changed.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Replace 'failed_assertion'
      	dg-prune-output reason with 'builtin_unreachable'.
      	* testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc: Likewise.
      	* testsuite/25_algorithms/equal/debug/constexpr_neg.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/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.
      ad9c3941
    • Hans-Peter Nilsson's avatar
      libstdc++: Tweak timeout for testsuite/std/ranges/iota/max_size_type.cc · e9b639c4
      Hans-Peter Nilsson authored
      A simulator can easily spend more than 10 minutes running
      this test-case, and the default timeout is at 5 minutes.
      Better allow even slower machines; use 4 as the factor.
      
      Regarding relative runtime numbers (very local; mmixware simulator for
      mmix-knuth-mmixware): test01 and test05 finish momentarily; test02 at
      about 2 minutes, and test03 about 2m30, but test04 itself runs for
      more than 6 minues and so times out.
      
      Not sure if it's better to split up this test, as the excessive
      runtime may be unintended, but this seemed simplest.
      
      libstdc++-v3:
      	* testsuite/std/ranges/iota/max_size_type.cc: Set
      	dg-timeout-factor to 4.
      e9b639c4
  10. Aug 07, 2021
  11. Aug 06, 2021
Loading