diff mbox series

[committed,2/2] libstdc++: Use 202100L as feature test check for C++23

Message ID 20231116080314.1218556-2-jwakely@redhat.com
State New
Headers show
Series [committed,1/2] libstdc++: Adjust feature test in <istream> and <ostream> | expand

Commit Message

Jonathan Wakely Nov. 16, 2023, 8:02 a.m. UTC
Tested x86_64-linux. Pushed to trunk.

-- >8 --

I noticed that our C++23 features were not being defined when using
Clang 16 with -std=c++2b, because it only defines __cplusplus=202101L
but <bits/version.h> uses 202302L since my r14-3252-g0c316669b092fb
change.

This changes <bits/version.h> to use 202100 instead of the final 202302
value so that we support Clang 16's -std=c++2b mode.

libstdc++-v3/ChangeLog:

	* include/bits/version.def (stds): Use >= 202100 for C++23
	condition.
	* include/bits/version.h: Regenerate.
	* include/std/thread: Use > C++20 instead of >= C++23 for
	__cplusplus condition.
---
 libstdc++-v3/include/bits/version.def |  2 +-
 libstdc++-v3/include/bits/version.h   | 76 +++++++++++++--------------
 libstdc++-v3/include/std/thread       |  2 +-
 3 files changed, 40 insertions(+), 40 deletions(-)
diff mbox series

Patch

diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 8f008f9048f..2aab9426ecc 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -1640,7 +1640,7 @@  stds[11] = ">= 201103L";
 stds[14] = ">= 201402L";
 stds[17] = ">= 201703L";
 stds[20] = ">= 202002L";
-stds[23] = ">= 202302L";
+stds[23] = ">= 202100L"; // Should be 202302L but Clang 16 uses 202101L
 stds[26] = ">  202302L"; // TODO: update when finalized
 
 // Local Variables:
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread
index c182a4d56c1..39042d7cdf5 100644
--- a/libstdc++-v3/include/std/thread
+++ b/libstdc++-v3/include/std/thread
@@ -42,7 +42,7 @@ 
 # include <stop_token>	// std::stop_source, std::stop_token, std::nostopstate
 #endif
 
-#if __cplusplus >= 202302L
+#if __cplusplus > 202002L
 # include <format>
 #endif