Skip to content

[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

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

mordante
Copy link
Member

Implements:

  • P2871R3 Remove Deprecated Unicode Conversion Facets from C++26

@mordante mordante requested a review from a team as a code owner November 16, 2023 09:37
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Nov 16, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2023

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

Implements:

  • P2871R3 Remove Deprecated Unicode Conversion Facets from C++26

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:

  • (modified) libcxx/docs/ReleaseNotes/18.rst (+8)
  • (modified) libcxx/docs/Status/Cxx2cPapers.csv (+1-1)
  • (modified) libcxx/docs/UsingLibcxx.rst (+10)
  • (modified) libcxx/include/__config (+4)
  • (modified) libcxx/include/codecvt (+4)
  • (modified) libcxx/modules/std/codecvt.inc (+2)
  • (added) libcxx/test/libcxx/depr/enable_removed_cpp26_features.compile.pass.cpp (+20)
  • (modified) libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp (+1-1)
  • (modified) libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp (+1-1)
  • (modified) libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_mode.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_in.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_in.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locale.stdcvt/depr.verify.cpp (+3-2)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/depr.verify.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/depr.verify.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp (+1-1)
  • (modified) libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp (+1-1)
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]

Copy link
Member

@ldionne ldionne left a 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.

@mordante mordante force-pushed the GH-P2871R3-remove_codecvt branch from 637dd7c to 981f534 Compare November 22, 2023 19:49
Implements:
- P2871R3 Remove Deprecated Unicode Conversion Facets from C++26
@mordante mordante force-pushed the GH-P2871R3-remove_codecvt branch from 981f534 to c7a9c59 Compare November 24, 2023 16:34
@mordante mordante merged commit 233e7c5 into llvm:main Nov 24, 2023
@mordante mordante deleted the GH-P2871R3-remove_codecvt branch November 24, 2023 16:34
@zeroomega
Copy link
Contributor

This patch breaks runtime build for runtimes-x86_64-pc-windows-msvc target when using libcxx:

FAILED: libcxx/src/CMakeFiles/cxx_static.dir/locale.cpp.obj 
C:\b\s\w\ir\x\w\llvm_build\.\bin\clang-cl.exe --target=x86_64-pc-windows-msvc  /nologo -TP -DUNICODE -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ALLOW_MSC_VER_MISMATCH -D_CRTBLD -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -D_GLIBCXX_ASSERTIONS -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS="" -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src -IC:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -IC:/b/s/w/ir/x/w/llvm_build/include/c++/v1 /Zc:inline /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw -no-canonical-prefixes /Zi /O2 /Ob1  -std:c++latest -MT -UNDEBUG -W4 -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-compat -Wno-undef -Wno-reserved-id-macro -Wno-gnu-include-next -Wno-gcc-compat -Wno-zero-as-null-pointer-constant -Wno-deprecated-dynamic-exception-spec -Wno-sign-conversion -Wno-old-style-cast -Wno-deprecated -Wno-shift-sign-overflow -Wno-double-promotion -Wno-error -EHsc /showIncludes /Folibcxx/src/CMakeFiles/cxx_static.dir/locale.cpp.obj /Fdlibcxx\src\CMakeFiles\cxx_static.dir\cxx_static.pdb -c -- C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/locale.cpp
C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/locale.cpp(1789,49): error: unknown type name 'codecvt_mode'; did you mean 'codecvt_base'?
 1789 |               unsigned long Maxcode = 0x10FFFF, codecvt_mode mode = codecvt_mode(0))
      |                                                 ^~~~~~~~~~~~
      |                                                 codecvt_base
C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__locale(901,33): note: 'codecvt_base' declared here
  901 | class _LIBCPP_EXPORTED_FROM_ABI codecvt_base

Could you look into this please? If it takes a long time to fix, could you revert the change please?
Builder task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8763525736105044977/overview

@ldionne
Copy link
Member

ldionne commented Nov 27, 2023

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.

@mordante
Copy link
Member Author

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.

@petrhosek
Copy link
Member

petrhosek commented Nov 27, 2023

I wonder how that's any different from our other Windows jobs which were happy with this change.

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.

@petrhosek
Copy link
Member

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.

We're not, this is our Windows configuration for libc++:

set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

@mordante
Copy link
Member Author

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.

We're not, this is our Windows configuration for libc++:

set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

Thanks. I don't see anything odd in there. Once I have a PR I'll ping you so you can test locally.

@petrhosek
Copy link
Member

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.

We're not, this is our Windows configuration for libc++:

set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

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?

zeroomega added a commit to zeroomega/llvm-project that referenced this pull request Nov 28, 2023
@zeroomega
Copy link
Contributor

This patch breaks runtime build for runtimes-x86_64-pc-windows-msvc target when using libcxx:

FAILED: libcxx/src/CMakeFiles/cxx_static.dir/locale.cpp.obj 
C:\b\s\w\ir\x\w\llvm_build\.\bin\clang-cl.exe --target=x86_64-pc-windows-msvc  /nologo -TP -DUNICODE -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -D_ALLOW_MSC_VER_MISMATCH -D_CRTBLD -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -D_GLIBCXX_ASSERTIONS -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS="" -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src -IC:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -IC:/b/s/w/ir/x/w/llvm_build/include/c++/v1 /Zc:inline /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw -no-canonical-prefixes /Zi /O2 /Ob1  -std:c++latest -MT -UNDEBUG -W4 -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-compat -Wno-undef -Wno-reserved-id-macro -Wno-gnu-include-next -Wno-gcc-compat -Wno-zero-as-null-pointer-constant -Wno-deprecated-dynamic-exception-spec -Wno-sign-conversion -Wno-old-style-cast -Wno-deprecated -Wno-shift-sign-overflow -Wno-double-promotion -Wno-error -EHsc /showIncludes /Folibcxx/src/CMakeFiles/cxx_static.dir/locale.cpp.obj /Fdlibcxx\src\CMakeFiles\cxx_static.dir\cxx_static.pdb -c -- C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/locale.cpp
C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/src/locale.cpp(1789,49): error: unknown type name 'codecvt_mode'; did you mean 'codecvt_base'?
 1789 |               unsigned long Maxcode = 0x10FFFF, codecvt_mode mode = codecvt_mode(0))
      |                                                 ^~~~~~~~~~~~
      |                                                 codecvt_base
C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__locale(901,33): note: 'codecvt_base' declared here
  901 | class _LIBCPP_EXPORTED_FROM_ABI codecvt_base

Could you look into this please? If it takes a long time to fix, could you revert the change please? Builder task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8763525736105044977/overview

@mordante I looked at the original build failure a bit closer and discovered that -std:c++latest flag is present in this failed build step. In Fuchsia's build configuration, we didn't set this flag so it is probably something from llvm/libcxx's own build configuration, which we are still trying to figure out.

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.

ldionne pushed a commit to mordante/llvm-project that referenced this pull request Nov 29, 2023
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.
ldionne pushed a commit that referenced this pull request Nov 29, 2023
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.
zeroomega referenced this pull request Dec 1, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants