Skip to content
Snippets Groups Projects
  1. Mar 19, 2019
    • Jonathan Wakely's avatar
      Update libstdc++ API Evolution documentation · cad3fc8c
      Jonathan Wakely authored
      	* doc/xml/manual/allocator.xml: Link to table documenting evolution
      	of extension allocators.
      	* doc/xml/manual/evolution.xml: Use angle brackets for header names.
      	Document new headers in 7.2, 8.1 and 9.1 releases.
      	* doc/xml/manual/using.xml: Adjust link target for new_allocator.
      	* doc/html/*: Regenerate.
      
      From-SVN: r269794
      cad3fc8c
  2. Mar 08, 2019
  3. Mar 07, 2019
  4. Feb 14, 2019
    • Jonathan Wakely's avatar
      Update libstdc++ documentation for C++2a implementation status · 323694e9
      Jonathan Wakely authored
      	* doc/xml/manual/status_cxx2020.xml: Update P0887R1 status.
      	* doc/html/*: Regenerate.
      
      From-SVN: r268885
      323694e9
    • Jonathan Wakely's avatar
      Update libstdc++ documentation for implementation status · bb2a18a3
      Jonathan Wakely authored
      	* doc/xml/manual/status_cxx2017.xml: Add P0063R3 to status table.
      	* doc/html/*: Regenerate.
      
      From-SVN: r268883
      bb2a18a3
    • Jonathan Wakely's avatar
      DR 2586 fix value category in uses-allocator checks · b7dbc672
      Jonathan Wakely authored
      Because uses-allocator construction is invariably done with a const
      lvalue the __uses_alloc helper should use a const lvalue for the
      is_constructible checks. Otherwise, it can detect that the type can be
      constructed from an rvalue, and then an error happens when a const
      lvalue is passed to the constructor instead.
      
      Prior to LWG DR 2586 scoped_allocator_adaptor incorrectly used an rvalue
      type in the is_constructible check and then used a non-const lvalue for
      the actual construction. The other components using uses-allocator
      construction (tuple and polymorphic_allocator) have always done so with
      a const lvalue allocator, although the use of __use_alloc in our
      implementation meant they behaved the same as scoped_allocator_adaptor
      and incorrectly used rvalues for the is_constructible checks.
      
      In C++20 the P0591R4 changes mean that all uses-allocator construction
      is defined in terms of the new uses_allocator_construction_args
      functions, which always use a const lvalue allocator.
      
      The changes in this patch ensure that the __use_alloc helper correctly
      matches the requirements in the standard, consistently using a const
      lvalue allocator for the is_constructible checks and the actual
      constructor arguments.
      
      	* doc/xml/manual/intro.xml: Document LWG 2586 status.
      	* include/bits/uses_allocator.h (__uses_alloc): Use const lvalue
      	allocator type in is_constructible checks.
      	* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust dg-error.
      	* testsuite/20_util/scoped_allocator/dr2586.cc: New test.
      	* testsuite/20_util/tuple/cons/allocators.cc: Add test using
      	problematic type from LWG 2586 discussion.
      	* testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error.
      	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
      
      From-SVN: r268882
      b7dbc672
    • Jonathan Wakely's avatar
      LWG 2537 fix priority_queue constructors to establish invariant · 1f4dcbf7
      Jonathan Wakely authored
      This change is safe to make now (in stage 4), because the constructors
      are currently incorrect and unusable (unless the supplied container
      already contains a heap, in which case the new make_heap calls are
      redundant but harmless).
      
      	* doc/xml/manual/intro.xml: Document LWG 2537 status.
      	* include/bits/stl_queue.h
      	(priority_queue(const Compare&, const Container&, const Alloc&))
      	(priority_queue(const Compare&, Container&&, const Alloc&)): Call
      	make_heap.
      	* testsuite/23_containers/priority_queue/dr2537.cc: New test.
      
      From-SVN: r268878
      1f4dcbf7
    • Jonathan Wakely's avatar
      Enforce LWG DR 2566 requirement for container adaptors · 1138a19d
      Jonathan Wakely authored
      Although there is no good use for stack<int, deque<double>> or similar
      types with a mismatched value_type, it's possible somebody is doing that
      and getting away with it currently. This patch only enforces the new
      requirement for C++17 and later. During stage 1 we should consider
      enforcing it for C++11 and C++14.
      
      	* doc/xml/manual/intro.xml: Document LWG 2566 status.
      	* include/bits/stl_queue.h (queue, priority_queue): Add static
      	assertions to enforce LWG 2566 requirement on value_type.
      	* include/bits/stl_stack.h (stack): Likewise.
      
      From-SVN: r268877
      1138a19d
    • Jonathan Wakely's avatar
      Document LWG 2735 status and add test · 8936f531
      Jonathan Wakely authored
      This DR was already resolved for GCC 7.1 by the implementation of DR
      2192, but we didn't have an explicit test for the behaviour that 2735
      guarantees.
      
      	* doc/xml/manual/intro.xml: Document LWG 2735 status.
      	* include/bits/std_abs.h: Add comment about LWG 2735.
      	* testsuite/26_numerics/headers/cstdlib/dr2735.cc: New test.
      
      From-SVN: r268867
      8936f531
  5. Jan 30, 2019
  6. Jan 15, 2019
    • Jonathan Wakely's avatar
      Fix missing or incorrect feature test macros · 56a9eaf9
      Jonathan Wakely authored
      	* doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
      	status.
      	* include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
      	Define.
      	* include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
      	changes are supported.
      	* include/std/optional (__cpp_lib_optional): Likewise.
      	* include/std/variant (__cpp_lib_variant): Likewise.
      	* include/std/version [!__STRICT_ANSI__]
      	(__cpp_lib_uncaught_exceptions): Define as long integer.
      	[__cplusplus >= 201703L] (__cpp_lib_any)
      	(__cpp_lib_raw_memory_algorithms, __cpp_lib_uncaught_exceptions)
      	(__cpp_lib_variant): Define for C++17.
      	[__cplusplus >= 201703L] (__cpp_lib_optional): Update value and define
      	as long integer.
      	* libsupc++/exception (__cpp_lib_uncaught_exceptions): Define as long
      	integer.
      
      From-SVN: r267936
      56a9eaf9
    • Jonathan Wakely's avatar
      * doc/xml/manual/status_cxx2020.xml: Update P1123R0 status. · 04fdd1fd
      Jonathan Wakely authored
      From-SVN: r267935
      04fdd1fd
  7. Jan 11, 2019
    • Jonathan Wakely's avatar
      Document C++20 library status · 66dc59e2
      Jonathan Wakely authored
      	* doc/xml/manual/intro.xml: Include new section.
      	* doc/xml/manual/status_cxx2017.xml: Document more
      	implementation-defined properties of the library.
      	* doc/xml/manual/status_cxx2020.xml: Document C++2a status.
      	* doc/html/*: Regenerate.
      
      From-SVN: r267867
      66dc59e2
  8. Jan 07, 2019
    • Jonathan Wakely's avatar
      Update documentation for C++17 filesystem library · f0f1121b
      Jonathan Wakely authored
      	* doc/xml/manual/spine.xml: Update copyright years.
      	* doc/xml/manual/status_cxx2017.xml: Adjust note about -lstdc++fs.
      	* doc/xml/manual/using.xml: Remove requirement to link with -lstdc++fs
      	for C++17 filesystem library.
      	* doc/html/*: Regenerate.
      
      From-SVN: r267648
      f0f1121b
  9. Dec 19, 2018
  10. Dec 11, 2018
  11. Nov 28, 2018
    • Jonathan Wakely's avatar
      Apply resolution for LWG DR 3096 · bd6ccc29
      Jonathan Wakely authored
      Add fix for "path::lexically_relative is confused by trailing slashes".
      
      	* doc/xml/manual/intro.xml: Document LWG 3096 change.
      	* src/filesystem/std-path.cc (path::lexically_relative(const path&)):
      	Treat a final empty element equivalently to a final dot element.
      	* testsuite/27_io/filesystem/path/generation/relative.cc: Add checks
      	for the examples in the DR.
      
      From-SVN: r266566
      bd6ccc29
    • Jonathan Wakely's avatar
      Update C++17 library status docs · 5916922e
      Jonathan Wakely authored
      	* doc/xml/manual/status_cxx2017.xml: Update C++17 status.
      	* doc/html/*: Regenerate.
      
      From-SVN: r266559
      5916922e
  12. Nov 27, 2018
    • Jonathan Wakely's avatar
      PR libstdc++/67843 set shared_ptr lock policy at build-time · da29d2a3
      Jonathan Wakely authored
      This resolves a longstanding issue where the lock policy for shared_ptr
      reference counting depends on compilation options when the header is
      included, so that different -march options can cause ABI changes. For
      example, objects compiled with -march=armv7 will use atomics to
      synchronize reference counts, and objects compiled with -march=armv5t
      will use a mutex. That means the shared_ptr control block will have a
      different layout in different objects, causing ODR violations and
      undefined behaviour. This was the root cause of PR libstdc++/42734 as
      well as PR libstdc++/67843.
      
      The solution is to decide on the lock policy at build time, when
      libstdc++ is configured. The configure script checks for the
      availability of the necessary atomic built-ins for the target and fixes
      that choice permanently. Different -march flags used to compile user
      code will not cause changes to the lock policy. This results in an ABI
      change for certain compilations, but only where there was already an ABI
      incompatibility between the libstdc++.so library and objects built with
      an incompatible -march option. In general, this means a more stable ABI
      that isn't silently altered when -march flags make addition atomic ops
      available.
      
      To force a target to use "atomic" or "mutex" the new configure option
      --with-libstdcxx-lock-policy can be used.
      
      In order to turn ODR violations into linker errors, the uses of
      shared_ptr in filesystem directory iterators have been replaced
      with __shared_ptr, and explicit instantiations are declared. This
      ensures that object files using those types cannot link to libstdc++
      libs unless they use the same lock policy.
      
      	PR libstdc++/67843
      	* acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Add new macro
      	that defines _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Use GLIBCXX_ENABLE_LOCK_POLICY.
      	* doc/xml/manual/configure.xml: Document new configure option.
      	* include/bits/fs_dir.h (directory_iterator): Use __shared_ptr
      	instead of shared_ptr.
      	(recursive_directory_iterator): Likewise.
      	(__shared_ptr<_Dir>): Add explicit instantiation declaration.
      	(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
      	* include/bits/shared_ptr_base.h (__allocate_shared, __make_shared):
      	Add default template argument for _Lock_policy template parameter.
      	* include/ext/concurrence.h (__default_lock_policy): Check macro
      	_GLIBCXX_HAVE_ATOMIC_LOCK_POLICY instead of checking if the current
      	target supports the builtins for compare-and-swap.
      	* src/filesystem/std-dir.cc (__shared_ptr<_Dir>): Add explicit
      	instantiation definition.
      	(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
      	(directory_iterator, recursive_directory_iterator): Use __make_shared
      	instead of make_shared.
      
      From-SVN: r266533
      da29d2a3
  13. Oct 01, 2018
  14. Sep 30, 2018
  15. Sep 24, 2018
  16. Sep 23, 2018
  17. Sep 01, 2018
  18. Aug 22, 2018
  19. Aug 14, 2018
    • Jonathan Wakely's avatar
      PR libstdc++/85343 overload __throw_ios_failure to take errno · 484e936e
      Jonathan Wakely authored
      [ios::failure] p2: "When throwing ios_base::failure exceptions,
      implementations should provide values of ec that identify the specific
      reason for the failure."
      
      This adds a new overload of __throw_ios_failure that can be passed
      errno, to store error_code(errno, system_category()) in the exception
      object.
      
      	PR libstdc++/85343
      	* acinclude.m4 (libtool_VERSION): Bump version.
      	* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Add new symbol version.
      	Export new symbol.
      	* configure: Regenerate.
      	* doc/xml/manual/abi.xml: Document new versions.
      	* include/bits/fstream.tcc (basic_filebuf<C, T>::underflow)
      	(basic_filebuf<C, T>::xsgetn): Pass errno to __throw_ios_failure.
      	* include/bits/functexcept.h (__throw_ios_failure(const char*, int)):
      	Declare new overload.
      	* src/c++11/cxx11-ios_failure.cc (__ios_failure): Add new constructor
      	and static member function.
      	(__throw_ios_failure(const char*, int)): Define.
      	* src/c++98/ios_failure.cc [!_GLIBCXX_USE_DUAL_ABI]
      	(__throw_ios_failure(const char*, int)): Define.
      	* testsuite/util/testsuite_abi.cc: Update known and latest versions.
      
      From-SVN: r263535
      484e936e
  20. Aug 10, 2018
    • Jonathan Wakely's avatar
      PR libstdc++/68210 adjust operator new and delete for LWG 206 · b66e5a95
      Jonathan Wakely authored
      Ensure that nothrow versions of new and delete call the ordinary
      versions of new or delete, instead of calling malloc or free directly.
      
      These files are all compiled with -std=gnu++14 so can use noexcept and
      nullptr to make the code more readable.
      
      	PR libstdc++/68210
      	* doc/xml/manual/intro.xml: Document LWG 206 change.
      	* libsupc++/del_op.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
      	* libsupc++/del_opa.cc: Likewise.
      	* libsupc++/del_opant.cc: Likewise.
      	* libsupc++/del_opnt.cc: Likewise. Call operator delete(ptr) instead
      	of free(ptr).
      	* libsupc++/del_ops.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
      	* libsupc++/del_opsa.cc: Likewise.
      	* libsupc++/del_opva.cc: Likewise.
      	* libsupc++/del_opvant.cc: Likewise.
      	* libsupc++/del_opvnt.cc: Likewise. Call operator delete[](ptr)
      	instead of operator delete(ptr).
      	* libsupc++/del_opvs.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
      	* libsupc++/del_opvsa.cc: Likewise.
      	* libsupc++/new_op.cc: Use __builtin_expect in check for zero size.
      	* libsupc++/new_opa.cc: Use nullptr instead of literal 0.
      	* libsupc++/new_opant.cc: Likewise. Replace _GLIBCXX_USE_NOEXCEPT
      	with noexcept.
      	* libsupc++/new_opnt.cc: Likewise. Call operator new(sz) instead of
      	malloc(sz).
      	* libsupc++/new_opvant.cc: Use nullptr and noexcept.
      	* libsupc++/new_opvnt.cc: Likewise. Call operator new[](sz) instead of
      	operator new(sz, nothrow).
      	* testsuite/18_support/new_nothrow.cc: New test.
      
      From-SVN: r263478
      b66e5a95
  21. Aug 08, 2018
  22. Jul 31, 2018
    • Jonathan Wakely's avatar
      Improve libstdc++ docs w.r.t newer C++ standards · 3e64a626
      Jonathan Wakely authored
      Instead of repeating all the old headers for every new standard I've
      changed the docs to only list the new headers for each standard.
      
      	* doc/xml/manual/test.xml: Improve documentation on writing tests for
      	newer standards.
      	* doc/xml/manual/using.xml: Document all headers for C++11 and later.
      	* doc/html/*: Regenerate.
      
      From-SVN: r263163
      3e64a626
  23. Jun 25, 2018
  24. Jun 15, 2018
    • Jonathan Wakely's avatar
      LWG 3076 basic_string CTAD ambiguity · 5d84e6c5
      Jonathan Wakely authored
      When deduction guides are supported by the compiler (i.e. for C++17 and
      later) replace two basic_string constructors by constrained function
      templates as required by LWG 3075. In order to ensure that the pre-C++17
      non-template constructors are still exported from the shared library
      define a macro in src/c++11/string-inst.cc to force the non-template
      declarations (this isn't strictly needed yet, because the string
      instantiations are compiled with -std=gnu++11, but that is likely to
      change).
      
      	LWG 3076 basic_string CTAD ambiguity
      	* doc/xml/manual/intro.xml: Document LWG 3076 change.
      	* include/bits/basic_string.h
      	[__cpp_deduction_guides && !_GLIBCXX_DEFINING_STRING_INSTANTIATIONS]
      	(basic_string(const _CharT*, const _Alloc&)): Turn into a function
      	template constrained by _RequireAllocator.
      	(basic_string(size_type, _CharT, const _Alloc&)): Likewise.
      	* src/c++11/string-inst.cc (_GLIBCXX_DEFINING_STRING_INSTANTIATIONS):
      	Define.
      	* testsuite/21_strings/basic_string/cons/char/deduction.cc: Test
      	deduction
      	* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
      	Likewise.
      
      From-SVN: r261670
      5d84e6c5
    • Jonathan Wakely's avatar
      LWG 2993 reference_wrapper<T> conversion from T&& · 7f93abd8
      Jonathan Wakely authored
      	* doc/xml/manual/intro.xml: Document LWG 2993 change.
      	* include/bits/refwrap.h (reference_wrapper(_Tp&)): Remove.
      	(reference_wrapper(_Tp&&)): Remove.
      	(reference_wrapper<_Up>(_Up&&)): Define new constructor as constrained
      	template.
      	(reference_wrapper): Add deduction guide.
      	* testsuite/20_util/reference_wrapper/deduction.cc: New.
      	* testsuite/20_util/reference_wrapper/lwg2993.cc: New.
      
      From-SVN: r261632
      7f93abd8
  25. Jun 14, 2018
    • Jonathan Wakely's avatar
      LWG 3074 make scalar types non-deduced in valarray non-member functions · db5ab3aa
      Jonathan Wakely authored
      	* include/bits/valarray_after.h (_DEFINE_EXPR_BINARY_FUNCTION): Change
      	scalar parameters to be a non-deduced context.
      	* include/std/valarray (_DEFINE_BINARY_OPERATOR): Likewise. Adjust
      	whitespace.
      	* testsuite/26_numerics/valarray/operators.cc: Test scalar operands.
      	* testsuite/26_numerics/valarray/transcend.cc: New.
      
      From-SVN: r261610
      db5ab3aa
  26. May 10, 2018
    • Jonathan Wakely's avatar
      Document Dual ABI for std::ios_base::failure · 0f8a1c15
      Jonathan Wakely authored
      	* doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer.
      	* doc/xml/manual/debug_mode.xml: Add array and forward_list to list
      	of C++11 containers with Debug Mode support.
      	* doc/xml/manual/using.xml: Document Dual ABI for ios_base::failure.
      	* doc/html/*: Regenerate.
      
      From-SVN: r260129
      0f8a1c15
  27. May 07, 2018
  28. Apr 11, 2018
    • Jonathan Wakely's avatar
      Update libstdc++ manual in preparation for GCC 8 release · 52556a87
      Jonathan Wakely authored
      	* doc/xml/manual/abi.xml: Document header locations in recent
      	releases.
      	* doc/xml/manual/evolution.xml: Add API changes since GCC 5.
      	* doc/xml/manual/spine.xml: Update copyright years.
      	* doc/xml/manual/strings.xml: Adjust tolower example to avoid
      	undefined behaviour.
      	* doc/xml/manual/test.xml: Update outdated notes on VERIFY in tests.
      	* doc/html/*: Regenerate.
      
      From-SVN: r259308
      52556a87
  29. Apr 10, 2018
    • Jonathan Wakely's avatar
      Update links to archived copy of SGI STL docs · 25949ee3
      Jonathan Wakely authored
      	* doc/xml/faq.xml: Update links to archived copy of SGI STL docs.
      	* doc/xml/manual/backwards_compatibility.xml: Likewise.
      	* doc/xml/manual/containers.xml: Likewise.
      	* doc/xml/manual/debug_mode.xml: Likewise.
      	* doc/xml/manual/extensions.xml: Likewise.
      	* doc/xml/manual/policy_data_structures_biblio.xml: Likewise.
      	* doc/xml/manual/using.xml: Likewise.
      	* doc/xml/manual/utilities.xml: Likewise.
      
      From-SVN: r259286
      25949ee3
Loading