Commit Graph

10824 Commits

Author SHA1 Message Date
Tobias Burnus 34fdecb2eb Merge remote-tracking branch 'origin/releases/gcc-9' into devel/omp/gcc-9
Update all GCC 9 commits between tag 'releases/gcc-9.2.0' (r9-7613) and
today's GCC 9 branch (r9-8340-g7beafc829c5b122298093ba517023015611aeca8).
2020-03-05 14:47:08 +01:00
Tobias Burnus 526632f93d Merge commit 'a0c06cc27d2146b7d86758ffa236516c6143d62c' into devel/omp/gcc-9
This merges all patches after releases/gcc-9.1.0 until and including
to the commit belonging to the tag 'releases/gcc-9.2.0'. That's
r9-7613-ga0c06cc27d2146b7d86758ffa236516c6143d62c on the releases/gcc-9
branch.
2020-03-05 14:39:50 +01:00
Chung-Lin Tang 495c501dd7 Commit of https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00336.html
2019-07-04  Chung-Lin Tang <cltang@codesourcery.com>

        libatomic/
        PR other/79543
        * acinclude.m4 (LIBAT_CHECK_LINKER_FEATURES): Fix GNU ld --version
        scanning to conform to the GNU Coding Standards.
        * configure: Regenerate.

        libffi/
        PR other/79543
        * acinclude.m4 (LIBAT_CHECK_LINKER_FEATURES): Fix GNU ld --version
        scanning to conform to the GNU Coding Standards.
        * configure: Regenerate.

        libgomp/
        PR other/79543
        * acinclude.m4 (LIBGOMP_CHECK_LINKER_FEATURES): Fix GNU ld --version
        scanning to conform to the GNU Coding Standards.
        * configure: Regenerate.

        libitm/
        PR other/79543
        * acinclude.m4 (LIBITM_CHECK_LINKER_FEATURES): Fix GNU ld --version
        scanning to conform to the GNU Coding Standards.
        * configure: Regenerate.

        libstdc++-v3/
        PR other/79543
        * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Fix GNU ld --version
        scanning to conform to the GNU Coding Standards.
        * configure: Regenerate.

(cherry picked from openacc-gcc-9-branch commit
b3c9281e6a)
2020-03-03 12:49:59 +01:00
H.J. Lu 4630b748e6 x32: Update baseline_symbols.txt
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.

(cherry picked from commit fed76afb95)
2020-03-01 06:17:03 -08:00
John David Anglin c3fed15104 Skip charset.cc tests on *-*-hpux*.
2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

	* testsuite/17_intro/headers/c++1998/charset.cc: Skip on *-*-hpux*.
	* testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2020/charset.cc: Likewise.
2020-02-29 21:07:08 +00:00
Jonathan Wakely a29236a23c libstdc++: Fix undefined behaviour in random dist serialization (PR93205)
The deserialization functions for random number distributions fail to
check the stream state before using the extracted values. In some cases
this leads to using indeterminate values to resize a vector, and then
filling that vector with indeterminate values.

No values that affect control flow should be used without checking that a
good value was read from the stream.

Additionally, where reasonable to do so, defer modifying any state in
the distribution until all values have been successfully read, to avoid
modifying some of the distribution's parameters and leaving others
unchanged.

Backport from mainline
2020-01-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93205
	* include/bits/random.h (operator>>): Check stream operation succeeds.
	* include/bits/random.tcc: (operator>>): Likewise.
	(__extract_params): New function to fill a vector from a stream.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.
2020-02-26 16:31:19 +00:00
Jonathan Wakely 7a7ef79651 libstdc++: Fix description of std::ios::trunc (PR 92886)
Backport from mainline
2019-12-10  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92886
	* include/bits/ios_base.h (std::ios_base::trunc): Fix comment.
2020-02-26 16:31:19 +00:00
Jonathan Wakely 08a70a6567 libstdc++: Replace glibc-specific check for clock_gettime (PR 93325)
It's wrong to assume that clock_gettime is unavailable on any *-*-linux*
target that doesn't have glibc 2.17 or later. Use a generic test instead
of using __GLIBC_PREREQ. Only do that test when is_hosted=yes so that we
don't get an error for cross targets without a working linker.

This ensures that C library's clock_gettime will be used on non-glibc
targets, instead of an incorrect syscall to SYS_clock_gettime.

Backport from mainline
2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93325
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
	clock_gettime instead of explicit glibc version check.
	* configure: Regenerate.
2020-02-26 15:32:34 +00:00
Jonathan Wakely 30cb4c78ea libstdc++: Fix regressions in unique_ptr::swap (PR 93562)
The requirements for this function are only that the deleter is
swappable, but we incorrectly require that the element type is complete
and that the deleter can be swapped using std::swap (which requires it
to be move cosntructible and move assignable).

The fix is to add __uniq_ptr_impl::swap which swaps the pointer and
deleter individually, instead of using the generic std::swap on the
tuple containing them.

	PR libstdc++/93562
	* include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
	(unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
	* testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
2020-02-26 15:04:53 +00:00
Jonathan Wakely 1b522a7913 libstdc++: Fix freestanding build (PR 92376)
In a freestanding library we don't install the <pstl/pstl_config.h>
header, so don't try to include it unless it exists.

Explicitly declare aligned alloc functions for freestanding, because
<cstdlib> doesn't declare them.

Backport from mainline
2020-01-17  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92376
	* include/bits/c++config: Only do PSTL config when the header is
	present, to fix freestanding.
	* libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
	functions if they were detected by configure.
2020-02-26 14:24:06 +00:00
Jonathan Wakely 84a5534ce2 PR libstdc++/78552 only construct std::locale for C locale once
Backport from mainline
2019-10-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/78552
	* src/c++98/locale_init.cc (locale::classic()): Do not construct a new
	locale object for every call.
	(locale::_S_initialize_once()): Construct C locale here.
2020-02-26 14:00:07 +00:00
Jonathan Wakely e2bcf65fee libstdc++: Simplify makefile rule for largefile-config.h (PR91947)
The previous rule could leave an incomplete file if the build was
interrupted, which would then not be remade if make was run again.

This makes the rule more robust by writing to a temporary file and only
moving it into place as the final step. It also simplifies the rule so
that only the essential macro definitions are written to the file, not
the explanatory comments and commented out #undef lines.

Also, the macro for enabling LFS on Mac OS X 10.5 is now set
unconditionally, which is a bug fix from upstream autoconf.

Backport from mainline
2020-01-23  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91947
	* include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
	rule.
	* include/Makefile.in: Regenerate.
2020-01-24 11:18:43 +00:00
Jonathan Wakely 461c01b2d9 libstdc++: Fix recent documentation changes
Backport from mainline
2020-01-20  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/faq.xml: Fix grammar.
	* doc/xml/manual/appendix_contributing.xml: Improve instructions.
	* doc/xml/manual/spine.xml: Update copyright years.
	* doc/html/*: Regenerate.
2020-01-24 11:18:29 +00:00
Eric S. Raymond fd5b5c275d Clean up references to Subversion in documentation sources.
Clean up references to SVN in in the GCC docs, redirecting to Git
documentation as appropriate.

Where references to "the source code repository" rather than a
specific VCS make sense, I have used them. You might, after
all, change VCSes again someday.

I have not modified either generated HTML files nor maintainer scripts.
These changes should be complete with repect to the documentation tree.

2020-01-19  Eric S. Raymond <esr@thyrsus.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	Partial backport from mainline:

	2020-01-19  Eric S. Raymond <esr@thyrsus.com>

	gcc/
	* doc/contribute.texi: Update for SVN -> Git transition.
	* doc/install.texi: Likewise.

	libstdc++-v3
	* doc/xml/faq.xml: Update for SVN -> Git transition.
	* doc/xml/manual/appendix_contributing.xml: Likewise.
2020-01-19 18:10:52 -08:00
Jonathan Wakely 6cb662745d Build filesystem library with large file support
Enable AC_SYS_LARGEFILE to set the macros needed for large file APIs to
be used by default. We do not want to define those macros in the
public headers that users include. The values of the macros are copied
to a separate file that is only included by the filesystem sources
during the build, and then the macros in <bits/c++config.h> are renamed
so that they don't have any effect in user code including our headers.

Also use larger type for result of filesystem::file_size to avoid
truncation of large values on 32-bit systems (PR 91947).

Backport from mainlne
2019-10-04  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/81091
	PR libstdc++/91947
	* configure.ac: Use AC_SYS_LARGEFILE to enable 64-bit file APIs.
	* config.h.in: Regenerate:
	* configure: Regenerate:
	* include/Makefile.am (${host_builddir}/largefile-config.h): New
	target to generate config header for filesystem library.
	(${host_builddir}/c++config.h): Rename macros for large file support.
	* include/Makefile.in: Regenerate.
	* src/c++17/fs_dir.cc: Include new config header.
	* src/c++17/fs_ops.cc: Likewise.
	(filesystem::file_size): Use uintmax_t for size.
	* src/filesystem/dir.cc: Include new config header.
	* src/filesystem/ops.cc: Likewise.
	(experimental::filesystem::file_size): Use uintmax_t for size.
2020-01-13 18:51:22 +00:00
Jonathan Wakely c6f60a62b0 libstdc++: Fix documentation claiming to refer to mainline
* doc/xml/manual/status_cxx1998.xml: Replace incorrect statement
	about documenting mainline.
	* doc/xml/manual/status_cxx2011.xml: Likewise.
	* doc/xml/manual/status_cxx2014.xml: Likewise.
	* doc/xml/manual/status_cxx2017.xml: Likewise.
	* doc/xml/manual/status_cxx2020.xml: Likewise.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
	* doc/html/*: Regenerate.
2020-01-13 16:35:59 +00:00
Jonathan Wakely 1ec66f8b7a libstdc++: Define memory resource key functions non-inline (PR93208)
This prevents the vtables and RTTI from being emitted in every object
file that uses memory_resource and monotonic_buffer_resource.

Objects compiled by GCC 9.1 or 9.2 will contain inline definitions of
the destructors, vtable and RTTI, but this is harmless. The inline
definitions have identical effects to the ones that are now defined in
libstdc++.so so it doesn't matter if the inline ones are used instead of
calling the symbols exported from the runtime library.

	PR libstdc++/93208
	* config/abi/pre/gnu.ver: Add new exports.
	* include/std/memory_resource (memory_resource::~memory_resource()):
	Do not define inline.
	(monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
	* src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
	Define.
	(monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
	* testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.

From-SVN: r280045
2020-01-09 13:18:37 +00:00
Jonathan Wakely 97173f7e2d libstdc++: Fix error handling in filesystem::remove_all (PR93201)
When recursing into a directory, any errors that occur while removing a
directory entry are ignored, because the subsequent increment of the
directory iterator clears the error_code object.

This fixes that bug by checking the result of each recursive operation
before incrementing. This is a change in observable behaviour, because
previously other directory entries would still be removed even if one
(or more) couldn't be removed due to errors. Now the operation stops on
the first error, which is what the code intended to do all along. The
standard doesn't specify what happens in this case (because the order
that the entries are processed is unspecified anyway).

	PR libstdc++/93201
	* src/c++17/fs_ops.cc (remove_all(const path&, error_code&)): Check
	result of recursive call before incrementing iterator.
	* src/filesystem/ops.cc (remove_all(const path&, error_code&)):
	Likewise.
	* testsuite/27_io/filesystem/operations/remove_all.cc: Check errors
	are reported correctly.
	* testsuite/experimental/filesystem/operations/remove_all.cc: Likewise.

From-SVN: r280020
2020-01-08 21:48:23 +00:00
Jonathan Wakely 0a0a04b446 libstdc++: Fix whitepace in changelog
From-SVN: r279224
2019-12-11 13:46:02 +00:00
Jonathan Wakely 5765ed7aaa PR libstdc++/91786 fix compilation error with Clang
Backport from mainline
2019-11-25  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91786
	* include/bits/fs_path.h (filesystem_error): Move definition before
	the use in u8path.

From-SVN: r279223
2019-12-11 13:45:56 +00:00
Thomas Rodgers 2f2585ed25 Restore enable_if lost during original import of pstl
* include/pstl/glue_numeric_defs.h: Restore enable_if lost during original
	import of pstl.
	* include/pstl/glue_numeric_impl.h: Likewise.

From-SVN: r279213
2019-12-11 03:38:53 +00:00
Jonathan Wakely 591185df09 libstdc++: fix buffer overflow in path::operator+= (PR92853)
When concatenating a path ending in a root-directory onto another path,
we added an empty filename to the end of the path twice, but only
reserved space for one. That meant the second write went past the end of
the allocated buffer.

	PR libstdc++/92853
	* src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
	Do not process a trailing directory separator twice.
	* testsuite/27_io/filesystem/path/concat/92853.cc: New test.
	* testsuite/27_io/filesystem/path/concat/path.cc: Test more cases.
	* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.

From-SVN: r279115
2019-12-09 11:16:29 +00:00
Jonathan Wakely a84ffd9675 PR libstdc++/92267 fix ABI change in deque iterators
Defaulting the copy constructor on its first declaration made it change
from user-provided (and non-trivial) to implicitly-defined (and
trivial). This caused an ABI incompatibility between GCC 8 and GCC 9,
where functions taking a deque iterator disagree on the argument passing
convention.

Backport from mainline
2019-10-29  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92267
	* include/bits/stl_deque.h (_Deque_iterator(const _Deque_iterator&)):
	Do not define as defaulted.
	* testsuite/23_containers/deque/types/92267.cc: New test.

From-SVN: r278614
2019-11-22 12:36:18 +00:00
John David Anglin 5366337461 baseline_symbols.txt: Update.
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r277511
2019-10-28 11:40:08 +00:00
Jonathan Wakely 14fe05d883 PR libstdc++/90682 allow set_terminate(0) and set_unexpected(0)
Make these functions restore the default handlers when passed a null
pointer. This is consistent with std::pmr::set_default_resource(0), and
also matches the current behaviour of libc++.

In order to avoid duplicating the preprocessor condition from
eh_term_handler.cc more that into a new eh_term_handler.h header and
define a macro that can be used in both eh_term_handler.cc and
eh_terminate.cc.

Backport from mainline
2019-05-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90682
	* libsupc++/eh_term_handler.cc: Include eh_term_handler.h to get
	definition of _GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_term_handler.h: New header defining
	_GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_terminate.cc: Include eh_term_handler.h.
	(set_terminate): Restore default handler when argument is null.
	(set_unexpected): Likewise.
	* testsuite/18_support/set_terminate.cc: New test.
	* testsuite/18_support/set_unexpected.cc: New test.

From-SVN: r277393
2019-10-24 13:55:27 +01:00
Jonathan Wakely e970705b48 PR libstdc++/61761 fix std::proj for targets without C99 cproj
The current generic implementation of __complex_proj used when cproj is
not available calculates the wrong projection, giving a different result
than given by C99's cproj.

When C99 cproj is not available but isinf and copysign are, use those to
give correct results for float, double and long double. Otherwise, and
for other specializations of std::complex, just use a generic version
that returns its argument, and so doesn't support infinities.

We might want to consider adding additional overloads of __complex_proj
to support extended types such as _Float64x, _Float128 etc.

Backport from mainline
2019-05-01  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/61761
	* include/std/complex (__complex_proj): Return parameter unchanged.
	[_GLIBCXX_USE_C99_COMPLEX] (__complex_proj): Change overloads for
	floating-point types to take std::complex arguments.
	[_GLIBCXX_USE_C99_MATH_TR1] (__complex_proj): Add overloads for
	floating-point types.
	* testsuite/26_numerics/complex/proj.cc: New test.

From-SVN: r277392
2019-10-24 13:55:21 +01:00
Jonathan Wakely 1b120c61b6 Fix more failing tests for C++98 mode
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Add
	dg-prune-output for different C++98 diagnostic.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/libstdc++-prettyprinters/compat.cc: Do not run for C++98.

From-SVN: r277391
2019-10-24 13:55:14 +01:00
Jonathan Wakely 4f03a8f011 Fix tests that fail with -std=gnu++98 or -std=gnu++11
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/20_util/is_nothrow_invocable/value.cc: Test converting to
	void.
	* testsuite/experimental/names.cc: Do not run for C++98 mode. Do not
	include Library Fundamentals or Networking headers in C++11 mode.
	* testsuite/ext/char8_t/atomic-1.cc: Do not run for C++98 mode.

From-SVN: r277390
2019-10-24 13:55:08 +01:00
Jonathan Wakely 7e6c09c180 Fix indentation in testsuite utility header
Backport from mainline
2019-05-14  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/util/testsuite_allocator.h (memory_resource)
	(default_resource_mgr): Fix indentation.

From-SVN: r277389
2019-10-24 13:55:03 +01:00
Jonathan Wakely f061d690d8 PR libstdc++/89164 enforce constraints for uninitialized algos
The memmove optimizations for std::uninitialized_copy/fill/_n will
compile even if the type is not copy constructible, because std::copy
doesn't require copy construction to work. But the uninitialized
algorithms do require it.

This adds explicit static assertions to ensure we don't allow ill-formed
initializations.

Backport from mainline
2019-08-30  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/89164
	* include/bits/stl_algobase.h (__copy_move): Give descriptive names
	to template parameters.
	* include/bits/stl_uninitialized.h (uninitialized_copy)
	(uninitialized_fill, uninitialized_fill_n): Add static assertions to
	diagnose invalid uses.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc:
	Adjust expected error.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	89164.cc: New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164_c++17.cc: New test.

From-SVN: r277388
2019-10-24 13:54:58 +01:00
Jonathan Wakely 8fa40f2cc3 Do not declare std::uses_allocator before C++11
Backport from mainline
2019-10-22  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
	* testsuite/17_intro/names.cc: Check uses_allocator in C++98.

From-SVN: r277387
2019-10-24 13:54:50 +01:00
Jonathan Wakely f37b9e32f7 PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX
version, namely that alignments smaller than sizeof(void*) are not
supported.

Backport from mainline
2019-10-18  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92143
	* libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment
	to at least sizeof(void*).

From-SVN: r277386
2019-10-24 13:54:44 +01:00
Jonathan Wakely 20bce52d36 Fix more tests that fail in C++2a mode
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/23_containers/unordered_map/requirements/debug_container.cc:
	Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Change
	dg-do directive for C++17 and C++2a.

From-SVN: r277385
2019-10-24 13:54:40 +01:00
Jonathan Wakely b2f56dd541 Fix testsuite bugs
One of the static assertions in 20_util/function_objects/invoke/1.cc was
wrong, but didn't fail because by default it was compiled with
-std=gnu++14 which didn't use that static assertion. Split out the C++17
parts to a new file that always runs with -std=gnu++17, so those checks
are always done. Also backport some extra tests from an earlier commit
on trunk (r271173).

The 23_containers/unordered_set/allocator/ext_ptr.cc test is supposed to
be a run-time test but was unintentionally compile-only.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/20_util/function_objects/invoke/1.cc: Add more tests.
	Move C++17-specific tests to ...
	* testsuite/20_util/function_objects/invoke/3.cc: New test.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Change
	"compile" test to "run".

From-SVN: r277384
2019-10-24 13:54:35 +01:00
Jonathan Wakely 5634905ded Add makefile target to update HTML files in source tree
Also remove the creation of the html/ext sub-directory, which has been
unused since revision r245258.

Backport from mainline
2019-10-08  Jonathan Wakely  <jwakely@redhat.com>

	* doc/Makefile.am (doc-html-docbook-regenerate): New target.
	(${docbook_outdir}/html): Do not create unused 'html/ext' directory.
	* doc/Makefile.in: Regenerate.
	* doc/xml/manual/documentation_hacking.xml: Document new target.
	* doc/html/*: Regenerate.

From-SVN: r277383
2019-10-24 13:54:30 +01:00
Jonathan Wakely f54588f620 Update URL for CUJ article in libstdc++ docs
* doc/xml/manual/allocator.xml: Use archived copy of CUJ article.

From-SVN: r277382
2019-10-24 13:54:23 +01:00
Jonathan Wakely 05c4872b3b Update URL for Hoard in libstdc++ docs
Backport from mainline
2019-05-31  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/allocator.xml: Move hoard.org back to http.

From-SVN: r277381
2019-10-24 13:54:18 +01:00
Jonathan Wakely b53e76509f PR libstdc++/91456 make INVOKE<R> work with uncopyable prvalues
In C++17 a function can return a prvalue of a type that cannot be moved
or copied. The current implementation of std::is_invocable_r uses
std::is_convertible to test the conversion to R required by INVOKE<R>.
That fails for non-copyable prvalues, because std::is_convertible is
defined in terms of std::declval which uses std::add_rvalue_reference.
In C++17 conversion from R to R involves no copies and so is not the
same as conversion from R&& to R.

This commit changes std::is_invocable_r to check the conversion without
using std::is_convertible.

std::function also contains a similar check using std::is_convertible,
which can be fixed by simply reusing std::is_invocable_r (but because
std::is_invocable_r is not defined for C++11 it uses the underlying
std::__is_invocable_impl trait directly).

Backport from mainline
2019-08-15  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91456
	* include/bits/std_function.h (__check_func_return_type): Remove.
	(function::_Callable): Use std::__is_invocable_impl instead of
	__check_func_return_type.
	* include/std/type_traits (__is_invocable_impl): Add another defaulted
	template parameter. Define a separate partial specialization for
	INVOKE and INVOKE<void>. For INVOKE<R> replace is_convertible check
	with a check that models delayed temporary materialization.
	* testsuite/20_util/function/91456.cc: New test.
	* testsuite/20_util/is_invocable/91456.cc: New test.

From-SVN: r277380
2019-10-24 13:54:13 +01:00
Jonathan Wakely a8b705aa43 Include netinet/in.h in include/experimental/internet
Backport from mainline
2019-09-30  Andreas Tobler  <andreast@gcc.gnu.org>

	* include/experimental/internet: Include netinet/in.h if we have
	_GLIBCXX_HAVE_NETINET_IN_H defined.

From-SVN: r277379
2019-10-24 13:54:09 +01:00
Jonathan Wakely 38cb5876a2 Fix array index error in address_v6 comparisons
Backport from mainline
2019-09-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/internet (operator==, operator<): Fix loop
	condition to avoid reading past the end of the array.

From-SVN: r277378
2019-10-24 13:54:05 +01:00
Jonathan Wakely 2cd084d864 P1651R0 bind_front should not unwrap reference_wrapper
Backport from mainline
2019-08-06  Jonathan Wakely  <jwakely@redhat.com>

	P1651R0 bind_front should not unwrap reference_wrapper
	* include/std/functional (bind_front): Don't unwrap reference_wrapper.
	* include/std/version (__cpp_lib_bind_front): Update value.
	* testsuite/20_util/function_objects/bind_front/1.cc: Fix test for
	feature test macro.
	* testsuite/20_util/function_objects/bind_front/2.cc: New test.

From-SVN: r277377
2019-10-24 13:54:00 +01:00
Jonathan Wakely de5a2a1923 PR libstdc++/92059 fix several bugs in tr2::dynamic_bitset
Backport from mainline
2019-10-11  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92059
	* include/tr2/dynamic_bitset (__dynamic_bitset_base): Define all
	special member functions as defaulted. Add noexcept to most members.
	(__dynamic_bitset_base(size_t, unsigned long long, const _Alloc&)):
	Mask off unwanted bits in the __val parameter. Avoid undefined left
	shifts.
	(__dynamic_bitset_base::_M_assign): Remove.
	(__dynamic_bitset_base::_M_do_reset): Use std::fill.
	(__dynamic_bitset_base::_M_are_all_aux): Avoid integer promotion when
	block_type has lower rank than int.
	(dynamic_bitset): Add noexcept to most members. Use injected-class-name
	in return types and parameter types.
	(dynamic_bitset::_M_Nb): Add default member initializer.
	(dynamic_bitset(), dynamic_bitset(const dynamic_bitset&)): Define as
	defaulted.
	(dynamic_bitset(dynamic_bitset&&)): Clear source object after move.
	(dynamic_bitset::operator=(const dynamic_bitset&)): Define as
	defaulted.
	(dynamic_bitset::operator=(dynamic_bitset&&)): Add noexcept-specifier.
	Define without using swap, to propagate allocator correctly.
	(dynamic_bitset(const char*, const _Alloc&)): Use strlen.
	(dynamic_bitset::_M_do_sanitize, dynamic_bitset::_M_do_fill): Use
	casts to avoid unwanted integer promotions.
	(dynamic_bitset::_M_copy_from_ptr): Rearrange template parameters and
	add default template arguments and default argument to simplify usage.
	(dynamic_bitset::_M_copy_from_string): Adjust call to _M_copy_from_ptr.
	(operator==(const dynamic_bitset&, const dynamic_bitset&))
	(operator<(const dynamic_bitset&, const dynamic_bitset&)): Use _M_Nb.
	* include/tr2/dynamic_bitset.tcc (dynamic_bitset::_M_copy_from_ptr):
	Adjust template parameters to match declaration.
	* testsuite/tr2/dynamic_bitset/cmp.cc: New test.
	* testsuite/tr2/dynamic_bitset/cons.cc: New test.
	* testsuite/tr2/dynamic_bitset/copy.cc: New test.
	* testsuite/tr2/dynamic_bitset/move.cc: New test.
	* testsuite/tr2/dynamic_bitset/pr92059.cc: New test.

From-SVN: r277376
2019-10-24 13:53:55 +01:00
Jonathan Wakely 506bcbef00 PR libstdc++/91748 fix std::for_each_n for random access iterators
PR libstdc++/91748
	* include/bits/stl_algo.h (for_each_n): Fix random access iterator
	case.
	* testsuite/25_algorithms/for_each/for_each_n.cc: Test with random
	access iterators.

From-SVN: r275684
2019-09-12 11:51:58 +01:00
Jonathan Wakely 14c154f953 Fix Xmethod for shared_ptr::use_count()
This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578

	* python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__):
	Fix syntax error.

From-SVN: r275645
2019-09-11 12:40:23 +01:00
Edward Smith-Rowland cf33425f64 Update docs for p858 - Constexpr iterator changes available since 9.1.
2019-09-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Update docs for p858 - Constexpr iterator changes available since 9.1.
	* doc/xml/manual/status_cxx2020.xml: Update p0858r0 status.

From-SVN: r275523
2019-09-09 17:17:48 +00:00
Jonathan Wakely 7a62100980 Update libstdc++ docs for library version bumps
* doc/xml/manual/abi.xml: Document 9.x library versions.
	* doc/html/*: Regenerate.

From-SVN: r275310
2019-09-02 12:10:03 +01:00
Rainer Orth 6e690485d5 Update Solaris baselines for GCC 9.3
* config/abi/post/i386-solaris2.10/baseline_symbols.txt: Regenerate.
	* config/abi/post/i386-solaris2.10/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/sparcv9/baseline_symbols.txt:
	Likewise.
	* config/abi/post/sparc-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.11/sparcv9/baseline_symbols.txt:
	Likewise.

From-SVN: r275300
2019-09-02 08:40:41 +00:00
Jonathan Wakely 7532a97151 PR libstdc++/91067 add more missing exports for directory iterators
PR libstdc++/91067
	* acinclude.m4 (libtool_VERSION): Bump to 6:28:0.
	* configure: Regenerate.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.28): Add new version. Export
	missing symbols.
	* testsuite/27_io/filesystem/iterators/91067.cc: Test move
	constructors.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r275033
2019-08-29 14:22:13 +01:00
Jakub Jelinek 0549ad5e34 baseline_symbols.txt: Update.
* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275029
2019-08-29 12:27:38 +02:00
Jonathan Wakely db2230347d Update ABI baselines for x86 and powerpc GNU targets
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275014
2019-08-28 23:16:33 +01:00