Jonathan Wakely 3836df7e89 libstdc++: Implement C++26 type checking for std::format args [PR115776]
Implement the changes from P2757R3, which enhance the parse context to
be able to do type checking on format arguments, and to use that to
ensure that args used for width and precisions are integral types.

libstdc++-v3/ChangeLog:

	PR libstdc++/115776
	* include/bits/version.def (format): Update for C++26.
	* include/bits/version.h: Regenerate.
	* include/std/format (basic_format_parse_context): Remove
	default argument from constructor and split into two
	constructors. Make the constructor taking size_t private for
	C++26 and later.
	(basic_format_parse_context::check_dynamic_spec): New member
	function template.
	(basic_format_parse_context::check_dynamic_spec_integral): New
	member function.
	(basic_format_parse_context::check_dynamic_spec_string):
	Likewise.
	(__format::_Spec::_S_parse_width_or_precision): Use
	check_dynamic_spec_integral.
	(__format::__to_arg_t_enum): New helper function.
	(basic_format_arg):  Declare __to_arg_t_enum as friend.
	(__format::_Scanner): Define and use a derived parse context
	type.
	(__format::_Checking_scanner): Make arg types available to parse
	context.
	* testsuite/std/format/functions/format.cc: Check for new values
	of __cpp_lib_format macro.
	* testsuite/std/format/parse_ctx.cc: Check all members of
	basic_format_parse_context.
	* testsuite/std/format/parse_ctx_neg.cc: New test.
	* testsuite/std/format/string.cc: Add more checks for dynamic
	width and precision args.
2024-07-31 17:07:10 +01:00
2024-07-20 00:17:53 +00:00
2024-07-12 00:17:52 +00:00
2024-07-08 00:17:01 +00:00
2024-07-03 00:19:01 +00:00
2024-07-19 00:18:20 +00:00
2024-07-31 00:19:44 +00:00
2024-07-26 00:17:23 +00:00
2024-07-02 00:17:36 +00:00
2024-07-26 00:17:23 +00:00
2024-07-17 00:18:32 +00:00
2024-07-20 00:17:53 +00:00
2024-07-29 00:16:31 +00:00

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.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%