c++: Adjust docs and option descriptions for the publishing of C++23

Now that C++23 has been finally published, the following patch attempts
to mention it in the option descriptions and documentation.
Given that it has been published about 1.5 years after being finalized
and has the 14882:2024 document number pair rather than :2023, I wasn't
sure when exactly to use 2023 (as informal name) and when 2024 (as year
of publishing), so I've tried to use 2024 in standards.texi which talks
more formally about the standards and a note that it has been published
in 2024 when it is talked about more informally.
I remember at least one older edition has been published in January too,
but the ISO pages pretend it was published still in December of the previous
year, in this case it doesn't.

2024-11-01  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* doc/standards.texi (C++ Language): Mention also the 2024
	revision and -std=gnu++23 option.
	* doc/invoke.texi (-std=): Adjust description of c++23, c++2b,
	gnu++23 and gnu++2b now that ISO C++ 14882:2024 is published.
gcc/c-family/
	* c.opt (std=c++2b, std=c++23, std=gnu++2b, std=gnu++23): Adjust
	description now that ISO C++ 14882:2024 is published.
This commit is contained in:
Jakub Jelinek 2024-11-01 19:50:28 +01:00 committed by Jakub Jelinek
parent 1ae24f7e0b
commit d949b94ea0
3 changed files with 26 additions and 16 deletions

View File

@ -2558,11 +2558,11 @@ Conform to the ISO 2020 C++ standard (experimental and incomplete support).
std=c++2b std=c++2b
C++ ObjC++ Alias(std=c++23) Undocumented C++ ObjC++ Alias(std=c++23) Undocumented
Conform to the ISO 2023 C++ draft standard (experimental and incomplete support). Conform to the ISO 2023 C++ standard (published in 2024; experimental and incomplete support).
std=c++23 std=c++23
C++ ObjC++ C++ ObjC++
Conform to the ISO 2023 C++ draft standard (experimental and incomplete support). Conform to the ISO 2023 C++ standard (published in 2024; experimental and incomplete support).
std=c++2c std=c++2c
C++ ObjC++ Alias(std=c++26) C++ ObjC++ Alias(std=c++26)
@ -2660,11 +2660,11 @@ Conform to the ISO 2020 C++ standard with GNU extensions (experimental and incom
std=gnu++2b std=gnu++2b
C++ ObjC++ Alias(std=gnu++23) Undocumented C++ ObjC++ Alias(std=gnu++23) Undocumented
Conform to the ISO 2023 C++ draft standard with GNU extensions (experimental and incomplete support). Conform to the ISO 2023 C++ standard with GNU extensions (published in 2024; experimental and incomplete support).
std=gnu++23 std=gnu++23
C++ ObjC++ C++ ObjC++
Conform to the ISO 2023 C++ draft standard with GNU extensions (experimental and incomplete support). Conform to the ISO 2023 C++ standard with GNU extensions (published in 2024; experimental and incomplete support).
std=gnu++2c std=gnu++2c
C++ ObjC++ Alias(std=gnu++26) C++ ObjC++ Alias(std=gnu++26)

View File

@ -2566,17 +2566,19 @@ Support is experimental, and could change in incompatible ways in
future releases. future releases.
The name @samp{gnu++2a} is deprecated. The name @samp{gnu++2a} is deprecated.
@item c++2b @item c++23
@itemx c++23 @itemx c++2b
The next revision of the ISO C++ standard, planned for The 2023 ISO C++ standard plus amendments (published in 2024).
2023. Support is highly experimental, and will almost certainly Support is experimental, and could change in incompatible ways in
change in incompatible ways in future releases. future releases.
The name @samp{c++2b} is deprecated.
@item gnu++2b @item gnu++23
@itemx gnu++23 @itemx gnu++2b
GNU dialect of @option{-std=c++2b}. Support is highly experimental, GNU dialect of @option{-std=c++23}.
and will almost certainly change in incompatible ways in future Support is experimental, and could change in incompatible ways in
releases. future releases.
The name @samp{gnu++2b} is deprecated.
@item c++2c @item c++2c
@itemx c++26 @itemx c++26

View File

@ -204,7 +204,7 @@ information concerning the history of C that is available online, see
@section C++ Language @section C++ Language
GCC supports the original ISO C++ standard published in 1998, GCC supports the original ISO C++ standard published in 1998,
and the 2011, 2014, 2017 and mostly 2020 revisions. and the 2011, 2014, 2017 and mostly 2020 and 2024 revisions.
The original ISO C++ standard was published as the ISO standard (ISO/IEC The original ISO C++ standard was published as the ISO standard (ISO/IEC
14882:1998) and amended by a Technical Corrigenda published in 2003 14882:1998) and amended by a Technical Corrigenda published in 2003
@ -245,6 +245,13 @@ new specification. For further details see
@uref{https://gcc.gnu.org/projects/@/cxx-status.html#cxx20}. @uref{https://gcc.gnu.org/projects/@/cxx-status.html#cxx20}.
To select this standard in GCC, use the option @option{-std=c++20}. To select this standard in GCC, use the option @option{-std=c++20}.
Yet another revised ISO C++ standard was published in 2024 as ISO/IEC
14882:2024, and is referred to as C++23; before its publication it was
sometimes referred to as C++2b. GCC supports most of the changes in the
new specification. For further details see
@uref{https://gcc.gnu.org/projects/@/cxx-status.html#cxx23}.
To select this standard in GCC, use the option @option{-std=c++23}.
More information about the C++ standards is available on the ISO C++ More information about the C++ standards is available on the ISO C++
committee's web site at @uref{https://www.open-std.org/@/jtc1/@/sc22/@/wg21/}. committee's web site at @uref{https://www.open-std.org/@/jtc1/@/sc22/@/wg21/}.
@ -263,7 +270,8 @@ select an extended version of the C++ language explicitly with
@option{-std=gnu++11} (for C++11 with GNU extensions), or @option{-std=gnu++11} (for C++11 with GNU extensions), or
@option{-std=gnu++14} (for C++14 with GNU extensions), or @option{-std=gnu++14} (for C++14 with GNU extensions), or
@option{-std=gnu++17} (for C++17 with GNU extensions), or @option{-std=gnu++17} (for C++17 with GNU extensions), or
@option{-std=gnu++20} (for C++20 with GNU extensions). @option{-std=gnu++20} (for C++20 with GNU extensions), or
@option{-std=gnu++23} (for C++23 with GNU extensions).
The default, if The default, if
no C++ language dialect options are given, is @option{-std=gnu++17}. no C++ language dialect options are given, is @option{-std=gnu++17}.