-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Removes codecvt. #72496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++] Removes codecvt. #72496
Conversation
@llvm/pr-subscribers-libcxx Author: Mark de Wever (mordante) ChangesImplements:
Patch is 39.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/72496.diff 54 Files Affected:
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index d5df7fde5be91af..5a18050d3a1b40a 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -48,6 +48,7 @@ Implemented Papers
- P2538R1 - ADL-proof ``std::projected``
- P2614R2 - Deprecate ``numeric_limits::has_denorm``
- P0053R7 - C++ Synchronized Buffered Ostream (in the experimental library)
+- P2871R3 - Remove Deprecated Unicode Conversion Facets from C++26
Improvements and New Features
@@ -68,6 +69,13 @@ Improvements and New Features
on a per translation unit basis using the ``_LIBCPP_HARDENING_MODE`` macro. See :ref:`the hardening documentation
<using-hardening-modes>` for more details.
+- The ``_LIBCPP_ENABLE_CXX26_REMOVED_FEATURES`` macro has been added to allow
+ re-enabling the removed features in C++26.
+
+- The ``_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT`` macro has been added to make
+ the declarations in ``<codecvt>`` available.
+
+
Deprecations and Removals
-------------------------
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv b/libcxx/docs/Status/Cxx2cPapers.csv
index eb5398f66d0e0c1..63ea9a79534bf92 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -38,7 +38,7 @@
"`P2821R5 <https://wg21.link/P2821R5>`__","LWG","``span.at()``","Kona November 2023","","",""
"`P2868R3 <https://wg21.link/P2868R3>`__","LWG","Remove Deprecated ``std::allocator`` Typedef From C++26","Kona November 2023","","",""
"`P2870R3 <https://wg21.link/P2870R3>`__","LWG","Remove ``basic_string::reserve()`` From C++26","Kona November 2023","","",""
-"`P2871R3 <https://wg21.link/P2871R3>`__","LWG","Remove Deprecated Unicode Conversion Facets from C++26","Kona November 2023","","",""
+"`P2871R3 <https://wg21.link/P2871R3>`__","LWG","Remove Deprecated Unicode Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
"`P2819R2 <https://wg21.link/P2819R2>`__","LWG","Add tuple protocol to complex","Kona November 2023","","",""
"`P2937R0 <https://wg21.link/P2937R0>`__","LWG","Freestanding: Remove ``strtok``","Kona November 2023","","",""
"`P2833R2 <https://wg21.link/P2833R2>`__","LWG","Freestanding Library: inout expected span","Kona November 2023","","",""
diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst
index 24d6a7b95f5b2e4..7efb499cd0a57b8 100644
--- a/libcxx/docs/UsingLibcxx.rst
+++ b/libcxx/docs/UsingLibcxx.rst
@@ -329,6 +329,16 @@ C++20 Specific Configuration Macros
`result_of` and `result_of_t`.
+C++26 Specific Configuration Macros
+-----------------------------------
+**_LIBCPP_ENABLE_CXX26_REMOVED_FEATURES**:
+ This macro is used to re-enable all the features removed in C++26. The effect
+ is equivalent to manually defining each macro listed below.
+
+**_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT**:
+ This macro is used to re-enable all named declarations in ``<codecvt>``.
+
+
Libc++ Extensions
=================
diff --git a/libcxx/include/__config b/libcxx/include/__config
index e8da358bb8d7cd5..6ad6aa17ced81a7 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1312,6 +1312,10 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
# define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
# endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
+# if defined(_LIBCPP_ENABLE_CXX26_REMOVED_FEATURES)
+# define _LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
+# endif // _LIBCPP_ENABLE_CXX26_REMOVED_FEATURES
+
// clang-format off
# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh()\")") _Pragma("push_macro(\"move(int, int)\")") _Pragma("push_macro(\"erase()\")")
# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh()\")") _Pragma("pop_macro(\"move(int, int)\")") _Pragma("pop_macro(\"erase()\")")
diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index 7a8c28d55941524..7a363280d52127c 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -63,6 +63,8 @@ class codecvt_utf8_utf16
# pragma GCC system_header
#endif
+#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
+
_LIBCPP_BEGIN_NAMESPACE_STD
enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode
@@ -553,6 +555,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
+
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <atomic>
# include <concepts>
diff --git a/libcxx/modules/std/codecvt.inc b/libcxx/modules/std/codecvt.inc
index 996036822bb40a0..277ef046349a9e0 100644
--- a/libcxx/modules/std/codecvt.inc
+++ b/libcxx/modules/std/codecvt.inc
@@ -9,10 +9,12 @@
export namespace std {
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
using std::codecvt_mode;
using std::codecvt_utf16;
using std::codecvt_utf8;
using std::codecvt_utf8_utf16;
+# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std
diff --git a/libcxx/test/libcxx/depr/enable_removed_cpp26_features.compile.pass.cpp b/libcxx/test/libcxx/depr/enable_removed_cpp26_features.compile.pass.cpp
new file mode 100644
index 000000000000000..d7661a043e47677
--- /dev/null
+++ b/libcxx/test/libcxx/depr/enable_removed_cpp26_features.compile.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Test that defining _LIBCPP_ENABLE_CXX26_REMOVED_FEATURES correctly defines
+// _LIBCPP_ENABLE_CXX26_REMOVED_FOO for each individual component macro.
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_FEATURES
+
+#include <__config>
+
+#include "test_macros.h"
+
+#ifndef _LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
+# error _LIBCPP_ENABLE_CXX26_REMOVED_CODECVT must be defined
+#endif
diff --git a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index 61e92089e4659c3..006bece21105b1a 100644
--- a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: c++03
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// <locale>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
index 699e6c20160febf..d57b7c20a2da272 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// UNSUPPORTED: c++03
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
index 4aeaa42c18adeb7..e7820739505106a 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// UNSUPPORTED: c++03
// <fstream>
diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
index 07789cadbf6a0a9..62fce70052c2a02 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
@@ -9,7 +9,7 @@
// XFAIL: availability-char8_t_support-missing
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// <locale>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp
index b7020ac0f161a90..a8a05da969da897 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// enum codecvt_mode
// {
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
index c38f11df5ac4d64..229c634116796ff 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
index f91706c77d25d67..ecf9b670895d3dd 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
index 12bfa096924b6fc..9e16daa221fb080 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp
index 8d4f48e8f54ddcf..f9dc6f0920355b9 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
index bf2f8af6e842800..68898957599f3d1 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
index e9c19e51b24e621..3a5f1e972b0d080 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
index 24b1d22881b4754..951e9cb51de7096 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
index 55cbf5a7d0717ed..fa6af0a7f3120a0 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
index 1f06de27d9aec0c..effd8d5317eadd3 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
index f25c8e45451054e..f6bb25b41acf0ff 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
index 55c1c5e52f766fa..25f308170a79b9c 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp
index 9abd0868f40a783..7f56bc0073ad90e 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
index 0d52894282bd0d1..bea2ba3d15768aa 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
index 32fdde30153ec80..41e9e5cc5654ff8 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
index 22636ca08980c2d..b6f872e9068c1cc 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
@@ -8,7 +8,7 @@
// <codecvt>
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// template <class Elem, unsigned long Maxcode = 0x10ffff,
// codecvt_mode Mode = (codecvt_mode)0>
diff --git a/libcxx/test/std/localization/locale.stdc...
[truncated]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! I have a few comments but this looks pretty good.
...xx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
Show resolved
Hide resolved
637dd7c
to
981f534
Compare
Implements: - P2871R3 Remove Deprecated Unicode Conversion Facets from C++26
981f534
to
c7a9c59
Compare
This patch breaks runtime build for
Could you look into this please? If it takes a long time to fix, could you revert the change please? |
I wonder how that's any different from our other Windows jobs which were happy with this change. @petrhosek Can we please set up Fuchsia pre-commit CI for libc++? These are becoming more and more frequent and disruptive. Given that we have an easy technical solution to avoid these post-commit failures via pre-commit checks, can you prioritize getting that set up? We can hop on a chat and I can assist with that, it's really not difficult. |
Are you building the library with C++26? This is something we do not test. I know how to fix it, I'll have a look at it. |
This issue is not Fuchsia-specific, our toolchain multiple different targets including Windows, and this issue happens to be manifesting in the build of Windows runtimes. We should figure out why this wasn't caught by the existing Windows jobs and add additional configuration if needed. |
We're not, this is our Windows configuration for libc++: llvm-project/clang/cmake/caches/Fuchsia-stage2.cmake Lines 130 to 132 in b29332a
|
Thanks. I don't see anything odd in there. Once I have a PR I'll ping you so you can test locally. |
@mordante Have you made any progress on the fix? Can we revert this PR if it cannot be resolved today? |
This reverts commit 233e7c5.
@mordante I looked at the original build failure a bit closer and discovered that This explains why upstream bots are not seeing this issue, because upstream bots are using stable clang toolchain that c++latest is not c++26, while we use ToT clang, which is c++26. |
The header is used in the dylib, this is not an issue at the moment since the dylib is built using C++23. Post release comments in llvm#72496 seem to indicate this removal is an issue for Fuchsia, this is a test so see whether it fixes the issue for their builds.
The header is used in the dylib, this is not an issue at the moment since the dylib is built using C++23 but it would be when building with C++26. Post release comments in #72496 seem to indicate this removal is an issue for Fuchsia.
We really shouldn't be depending on far away configuration options like LLVM_HAVE_LINK_VERSION_SCRIPT here. This patch simplifies the enablement of the linker scripts and as a result gets rid of an undesirable dependency on HandleLLVMOptions.cmake. As a drive-by, the patch also stops taking into account whether Python3 is available. This should have no bearing on whether we generate a linker script or not, which is required for correctness. If someone tries to build libc++ and generate a linker script but Python3 is not available, they should get an error instead of silently getting an incorrect installation of the library.
Implements: