Go to file
Jonathan Wakely af55b3af33 PR libstdc++/78448 limit vector::max_size and deque::max_size
The container requirements imply that max_size() can't exceed the
maximum value of the container's difference_type. Enforce this for
std::vector and std::deque, and add checks to ensure the container
doesn't grow larger than that.

	PR libstdc++/78448
	* include/bits/deque.tcc (deque::_M_range_initialize): Use
	_S_check_init_len to check size.
	(deque::_M_push_back_aux, deque::_M_push_front_aux): Throw length
	error if size would exceed max_size().
	* include/bits/stl_deque.h (_Deque_base::size_type): Remove typedef.
	(_Deque_base(_Deque_base&&, const allocator_type&, size_t)): Use
	size_t instead of size_type.
	(deq(size_type, const allocator_type&)
	(deq(size_type, const value_type&, const allocator_type&)
	(deque::_M_initialize_dispatch): Use _S_check_init_len to check size.
	(deque::max_size): Call _S_max_size.
	(deque::_S_check_init_len, deque::_S_max_size): New functions.
	* include/bits/stl_vector.h (vector(size_type, const allocator_type&))
	(vector(size_type, const value_type&, const allocator_type&))
	(vector::_M_initialize_dispatch, vector::_M_range_initialize): Use
	_S_check_init_len to check size.
	(vector::max_size): Call _S_max_size.
	(vector::_M_check_len): Prevent max from being expanded as a
	function-like macro.
	(vector::_S_check_init_len, vector::_S_max_size): New functions.
	* include/bits/vector.tcc (vector::_M_assign_aux): Use
	_S_check_init_len to check size.
	* testsuite/23_containers/deque/capacity/max_size.cc: New test.
	* testsuite/23_containers/vector/capacity/max_size.cc: New test.

From-SVN: r263789
2018-08-22 23:22:40 +01:00
INSTALL
config Add missing '|' as wrong patch was applied. 2018-07-05 14:28:01 -06:00
contrib C-SKY port: Configury 2018-08-17 15:00:25 -04:00
fixincludes inclhack.def (aix_unistd): New. 2018-07-23 16:51:50 -04:00
gcc gfortran.texi: Mention that asynchronous I/O does not work on systems which lack condition... 2018-08-22 21:29:49 +00:00
gnattools
gotools
include Add linker_output as prefix for LTO temps (PR lto/86548). 2018-07-26 12:13:14 +00:00
intl
libada
libatomic [ARM] Use __ARM_ARCH and __ARM_FEATURE_LDREX instead of __ARM_ARCH__ 2018-06-21 13:05:36 +02:00
libbacktrace libbacktrace: Suppress the default action-if-found for AC_CHECK_LIBS. 2018-08-05 20:24:59 +00:00
libcc1
libcpp [CPP PATCH] node field bits 2018-08-20 17:45:42 +00:00
libdecnumber Add missing '|' as wrong patch was applied. 2018-07-05 14:28:01 -06:00
libffi backport: ffi.c (ffi_call_go, [...]): New functions. 2018-08-15 06:57:45 +00:00
libgcc commit missed change from r263764 2018-08-22 12:05:45 +00:00
libgfortran gfortran.texi: Mention that asynchronous I/O does not work on systems which lack condition... 2018-08-22 21:29:49 +00:00
libgo runtime: use poll rather than pollset for netpoll on AIX 2018-08-07 17:29:50 +00:00
libgomp re PR fortran/25829 ([F03] Asynchronous IO support) 2018-08-21 18:48:59 +00:00
libhsail-rt
libiberty [libiberty patch] PEX-unix forking 2018-08-21 00:01:50 +00:00
libitm Remove nfs bogon 2018-08-03 14:53:48 -06:00
libobjc
liboffloadmic
libquadmath
libsanitizer Cherry-pick compiler-rt revision 338606 (PR sanitizer/86022). 2018-08-02 09:32:58 +00:00
libssp
libstdc++-v3 PR libstdc++/78448 limit vector::max_size and deque::max_size 2018-08-22 23:22:40 +01:00
libvtv
lto-plugin
maintainer-scripts
zlib Allow building of the zlib component when the building takes place in the source directory. 2018-06-19 11:49:08 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update global reviewers list 2018-08-21 13:49:30 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS Update write after approval list 2018-08-22 17:40:55 +00:00
Makefile.def Makefile.def (fortran): Add check-target-libgomp-fortran. 2018-06-18 22:01:58 +00:00
Makefile.in Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
Makefile.tpl Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
README
compile
config-ml.in
config.guess Update config.guess and config.sub 2018-07-06 05:57:35 +00:00
config.rpath
config.sub Update config.sub 2018-07-06 06:22:08 +00:00
configure Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
configure.ac Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 02:47:29 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltgcc.m4
ltmain.sh libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
symlink-tree
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.