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

Message ID ZyM9bF7PlJxNT9NO@tucnak
State New
Headers
Series c++: Adjust docs and option descriptions for the publishing of C++23 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Jakub Jelinek Oct. 31, 2024, 8:18 a.m. UTC
  Hi!

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.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2024-10-31  Jakub Jelinek  <jakub@redhat.com>

gcc/doc/
	* 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.


	Jakub
  

Comments

Jason Merrill Nov. 1, 2024, 4:11 p.m. UTC | #1
On 10/31/24 4:18 AM, Jakub Jelinek wrote:
> Hi!
> 
> 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.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.  I wonder if we want to add an undocumented -std=c++24 for pedants, 
but easier not to bother for now.

Jason
  

Patch

--- gcc/c-family/c.opt.jj	2024-10-27 16:42:47.992446624 +0100
+++ gcc/c-family/c.opt	2024-10-30 20:18:32.153034519 +0100
@@ -2558,11 +2558,11 @@  Conform to the ISO 2020 C++ standard (ex
 
 std=c++2b
 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
 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
 C++ ObjC++ Alias(std=c++26)
@@ -2660,11 +2660,11 @@  Conform to the ISO 2020 C++ standard wit
 
 std=gnu++2b
 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
 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
 C++ ObjC++ Alias(std=gnu++26)
--- gcc/doc/standards.texi.jj	2024-06-14 19:45:08.138794749 +0200
+++ gcc/doc/standards.texi	2024-10-30 20:20:45.322155825 +0100
@@ -204,7 +204,7 @@  information concerning the history of C
 @section C++ Language
 
 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
 14882:1998) and amended by a Technical Corrigenda published in 2003
@@ -245,6 +245,13 @@  new specification.  For further details
 @uref{https://gcc.gnu.org/projects/@/cxx-status.html#cxx20}.
 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++
 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++ la
 @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++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
 no C++ language dialect options are given, is @option{-std=gnu++17}.
--- gcc/doc/invoke.texi.jj	2024-10-30 07:57:03.622735779 +0100
+++ gcc/doc/invoke.texi	2024-10-30 20:19:13.849446284 +0100
@@ -2568,17 +2568,19 @@  Support is experimental, and could chang
 future releases.
 The name @samp{gnu++2a} is deprecated.
 
-@item c++2b
-@itemx c++23
-The next revision of the ISO C++ standard, planned for
-2023.  Support is highly experimental, and will almost certainly
-change in incompatible ways in future releases.
+@item c++23
+@itemx c++2b
+The 2023 ISO C++ standard plus amendments (published in 2024).
+Support is experimental, and could change in incompatible ways in
+future releases.
+The name @samp{c++2b} is deprecated.
 
-@item gnu++2b
-@itemx gnu++23
-GNU dialect of @option{-std=c++2b}.  Support is highly experimental,
-and will almost certainly change in incompatible ways in future
-releases.
+@item gnu++23
+@itemx gnu++2b
+GNU dialect of @option{-std=c++23}.
+Support is experimental, and could change in incompatible ways in
+future releases.
+The name @samp{gnu++2b} is deprecated.
 
 @item c++2c
 @itemx c++26