gcc/libcpp
Marek Polacek 5388a43f6a c++: Add support for -std={c,gnu}++2{c,6}
It seems prudent to add C++26 now that the first C++26 papers have been
approved.  I followed commit r11-6920 as well as r8-3237.

Since C++23 is essentially finished and its __cplusplus value has
settled to 202302L, I've updated cpp_init_builtins and marked
-std=c++2b Undocumented and made -std=c++23 no longer Undocumented.

As for __cplusplus, I've chosen 202400L:

  $ xg++ -std=c++26 -dM -E -x c++ - < /dev/null | grep cplusplus
  #define __cplusplus 202400L

I've verified the patch with a simple test, exercising the new
directives.  Don't forget to update your GXX_TESTSUITE_STDS!

This patch does not add -Wc++26-extensions.

gcc/c-family/ChangeLog:

	* c-common.h (cxx_dialect): Add cxx26 as a dialect.
	* c-opts.cc (set_std_cxx26): New.
	(c_common_handle_option): Set options when -std={c,gnu}++2{c,6} is
	enabled.
	(c_common_post_options): Adjust comments.
	* c.opt: Add options for -std=c++26, std=c++2c, -std=gnu++26,
	and -std=gnu++2c.
	(std=c++2b): Mark as Undocumented.
	(std=c++23): No longer Undocumented.

gcc/ChangeLog:

	* doc/cpp.texi (__cplusplus): Document value for -std=c++26 and
	-std=gnu++26.  Document that for C++23, its value is 202302L.
	* doc/invoke.texi: Document -std=c++26 and -std=gnu++26.
	* dwarf2out.cc (highest_c_language): Handle GNU C++26.
	(gen_compile_unit_die): Likewise.

libcpp/ChangeLog:

	* include/cpplib.h (c_lang): Add CXX26 and GNUCXX26.
	* init.cc (lang_defaults): Add rows for CXX26 and GNUCXX26.
	(cpp_init_builtins): Set __cplusplus to 202400L for C++26.
	Set __cplusplus to 202302L for C++23.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_c++23): Return
	1 also if check_effective_target_c++26.
	(check_effective_target_c++23_down): New.
	(check_effective_target_c++26_only): New.
	(check_effective_target_c++26): New.
	* g++.dg/cpp23/cplusplus.C: Adjust expected value.
	* g++.dg/cpp26/cplusplus.C: New test.
2023-06-23 16:46:29 -04:00
..
include c++: Add support for -std={c,gnu}++2{c,6} 2023-06-23 16:46:29 -04:00
po Daily bump. 2023-05-10 00:17:49 +00:00
aclocal.m4 libcpp: Enable Intel CET on Intel CET enabled host for jit 2020-05-12 09:17:45 -07:00
ChangeLog Daily bump. 2023-06-23 00:16:38 +00:00
ChangeLog.jit
charset.cc libcpp: allow UCS_LIMIT codepoints in UTF-8 strings 2023-06-23 16:04:12 -04:00
combining-chars.inc diagnostics: add support for "text art" diagrams 2023-06-21 21:49:00 -04:00
config.in build: re-configure 2 files 2022-11-21 09:03:35 +01:00
configure configure: Implement --enable-host-pie 2023-06-15 16:51:27 -04:00
configure.ac configure: Implement --enable-host-pie 2023-06-15 16:51:27 -04:00
directives.cc libcpp: Improve location for macro names [PR66290] 2023-06-20 16:58:12 -04:00
errors.cc Update copyright years. 2023-01-16 11:52:17 +01:00
expr.cc Update copyright years. 2023-01-16 11:52:17 +01:00
files.cc libcpp: Diagnose #include after failed __has_include [PR80753] 2023-06-15 14:16:17 +02:00
generated_cpp_wcwidth.h libcpp: Update cpp_wcwidth() to Unicode 15 2023-03-13 07:40:50 -04:00
identifiers.cc Update copyright years. 2023-01-16 11:52:17 +01:00
init.cc c++: Add support for -std={c,gnu}++2{c,6} 2023-06-23 16:46:29 -04:00
internal.h libcpp: Improve location for macro names [PR66290] 2023-06-20 16:58:12 -04:00
lex.cc Update copyright years. 2023-01-16 11:52:17 +01:00
line-map.cc Update copyright years. 2023-01-16 11:52:17 +01:00
location-example.txt
macro.cc libcpp: Improve location for macro names [PR66290] 2023-06-20 16:58:12 -04:00
Makefile.in Update copyright years. 2023-01-16 11:52:17 +01:00
makeucnid.cc libcpp: Update Unicode copyright years 2023-03-16 10:19:04 +01:00
makeuname2c.cc libcpp: Update Unicode copyright years 2023-03-16 10:19:04 +01:00
mkdeps.cc Update copyright years. 2023-01-16 11:52:17 +01:00
pch.cc libcpp: Improve location for macro names [PR66290] 2023-06-20 16:58:12 -04:00
printable-chars.inc diagnostics: add support for "text art" diagrams 2023-06-21 21:49:00 -04:00
symtab.cc Update copyright years. 2023-01-16 11:52:17 +01:00
system.h Update copyright years. 2023-01-16 11:52:17 +01:00
traditional.cc Update copyright years. 2023-01-16 11:52:17 +01:00
ucnid.h libcpp: Update Unicode copyright years 2023-03-16 10:19:04 +01:00
ucnid.tab Update copyright years. 2023-01-16 11:52:17 +01:00
uname2c.h libcpp: Update Unicode copyright years 2023-03-16 10:19:04 +01:00