[openmp] [libcxx] [clang] [clang-tools-extra] [llvm] [lldb] [mlir] [compiler-rt] [lld] [libc] [libcxxabi] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/9] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[clang] [compiler-rt] [openmp] [libcxx] [libc] [llvm] [libcxxabi] [clang-tools-extra] [mlir] [lldb] [lld] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/8] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[clang] [compiler-rt] [openmp] [libcxx] [libc] [llvm] [libcxxabi] [clang-tools-extra] [mlir] [lldb] [lld] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/8] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[llvm] [libcxxabi] [flang] [libc] [clang] [clang-tools-extra] [openmp] [mlir] [libcxx] [lldb] [compiler-rt] [lld] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/7] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[llvm] [libcxxabi] [flang] [libc] [clang] [clang-tools-extra] [openmp] [mlir] [libcxx] [lldb] [compiler-rt] [lld] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[openmp] [libcxx] [clang] [clang-tools-extra] [llvm] [lldb] [mlir] [compiler-rt] [lld] [libc] [libcxxabi] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,34 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___MEMORY_ALLOCATION_RESULT_H
+#define _LIBCPP___MEMORY_ALLOCATION_RESULT_H
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template 

H-G-Hristov wrote:

I guess this can be folded into `allocator_traits.h`.

https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[openmp] [libcxx] [clang] [clang-tools-extra] [llvm] [lldb] [mlir] [compiler-rt] [lld] [libc] [libcxxabi] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/6] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[libcxx] [clang] [clang-tools-extra] [llvm] [lldb] [mlir] [compiler-rt] [lld] [libc] [flang] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/6] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[compiler-rt] [libcxx] [mlir] [lldb] [libc] [flang] [llvm] [clang] [lld] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/5] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[libc] [clang] [lld] [libcxx] [llvm] [flang] [compiler-rt] [lldb] [clang-tools-extra] [mlir] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/4] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 2023","","",""

[libc] [clang] [lld] [libcxx] [llvm] [flang] [compiler-rt] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/4] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 2023","","",""

[libc] [clang] [lld] [libcxx] [llvm] [flang] [compiler-rt] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits


@@ -88,9 +88,9 @@ def add_version_header(tc):
 {
 "name": "__cpp_lib_allocate_at_least",
 "values": {
-"c++23": 202106,
+# "c++23": 202106,  # P0401R6 Providing size feedback in the 
Allocator interface

Zingam wrote:

```suggestion
```

https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [libcxx] [libc] [flang] [llvm] [clang] [lld] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam edited https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [libcxx] [libc] [flang] [llvm] [clang] [lld] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam edited https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [libcxx] [libc] [flang] [llvm] [clang] [lld] [clang-tools-extra] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-31 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,34 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___MEMORY_ALLOCATION_RESULT_H
+#define _LIBCPP___MEMORY_ALLOCATION_RESULT_H
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template 

Zingam wrote:

To unbreak a circular dependancy.

https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lld] [compiler-rt] [flang] [llvm] [libcxx] [clang-tools-extra] [clang] [libc] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-30 Thread Hristo Hristov via cfe-commits


@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization

H-G-Hristov wrote:

I thought so, removed it. Thank you for reviewing!

https://github.com/llvm/llvm-project/pull/79978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lld] [compiler-rt] [flang] [llvm] [libcxx] [clang-tools-extra] [clang] [libc] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-30 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/3] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[lld] [compiler-rt] [flang] [llvm] [libcxx] [clang-tools-extra] [clang] [libc] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-30 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/3] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[lld] [compiler-rt] [flang] [llvm] [libcxx] [clang-tools-extra] [clang] [libc] [libc++][memory] P2652R2: Disallow Specialization of `allocator_traits` (PR #79978)

2024-01-30 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79978

>From c2b9a249689b2b6928d50aeea4717fc9dfe87162 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 13:54:21 +0200
Subject: [PATCH 1/2] [libc++][memory] P2652R2 - Disallow Specialization of
 `allocator_traits`

Implements P2652R2 :
- https://eel.is/c++draft/allocator.requirements.general
- https://eel.is/c++draft/memory.syn
- https://eel.is/c++draft/allocator.traits.general
- https://eel.is/c++draft/allocator.traits.members
- https://eel.is/c++draft/diff.cpp20.concepts
- https://eel.is/c++draft/diff.cpp20.utilities
---
 libcxx/docs/FeatureTestMacroTable.rst |  2 +-
 libcxx/docs/ReleaseNotes/19.rst   |  6 +-
 libcxx/docs/Status/Cxx23Papers.csv|  2 +-
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/CMakeLists.txt |  1 +
 libcxx/include/__format/buffer.h  |  1 +
 libcxx/include/__memory/allocate_at_least.h   | 15 ++--
 libcxx/include/__memory/allocation_result.h   | 45 
 libcxx/include/__memory/allocator.h   |  1 +
 libcxx/include/__memory/allocator_traits.h| 13 
 libcxx/include/__split_buffer |  1 +
 libcxx/include/libcxx.imp |  1 +
 libcxx/include/memory | 12 ++--
 libcxx/include/module.modulemap.in|  1 +
 libcxx/include/string | 17 +++--
 libcxx/include/vector |  1 +
 libcxx/include/version|  4 +-
 libcxx/modules/std/memory.inc |  2 +
 .../memory.version.compile.pass.cpp   | 10 +--
 .../version.version.compile.pass.cpp  | 10 +--
 .../allocate_at_least.pass.cpp|  6 +-
 .../allocate_at_least.pass.cpp| 70 +++
 .../generate_feature_test_macro_components.py |  4 +-
 23 files changed, 189 insertions(+), 38 deletions(-)
 create mode 100644 libcxx/include/__memory/allocation_result.h
 create mode 100644 
libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_at_least.pass.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index d0d057e6bbaf0..a5c6fa22cec06 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -304,7 +304,7 @@ Status
 -
 ``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
 --- -
-``__cpp_lib_allocate_at_least`` ``202106L``
+``__cpp_lib_allocate_at_least`` ``202302L``
 --- -
 ``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index e96abc72c1648..dee9ebc8b8c33 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -37,12 +37,16 @@ What's New in Libc++ 19.0.0?
 
 Implemented Papers
 --
+
 - P2637R3 - Member ``visit``
+- P2652R2 - Disallow User Specialization of ``allocator_traits``
 
 
 Improvements and New Features
 -
-TODO
+
+- The ``_LIBCPP_ENABLE_CXX23_USER_SPECIALIZATION_OF_ALLOCATOR_TRAITS`` macro 
has been added to re-enable user specialization
+  of `allocator_traits`, which was disabled by `P2652R2 
`_.
 
 
 Deprecations and Removals
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index ebab3ef735b61..eb415ed8c031f 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -115,7 +115,7 @@
 "`P2679R2 `__","LWG", "Fixing 
``std::start_lifetime_as`` for arrays","February 2023","","",""
 "`P2674R1 `__","LWG", "A trait for implicit 
lifetime types","February 2023","","",""
 "`P2655R3 `__","LWG", "``common_reference_t`` of 
``reference_wrapper`` Should Be a Reference Type","February 2023","","",""
-"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","","",""
+"`P2652R2 `__","LWG", "Disallow User Specialization 
of ``allocator_traits``","February 2023","|Complete|","19.0",""
 "`P2787R1 `__","LWG", "``pmr::generator`` - Promise 
Types are not Values","February 2023","","",""
 "`P2614R2 `__","LWG", "Deprecate 
``numeric_limits::has_denorm``","February 2023","|Complete|","18.0",""
 "`P2588R3 `__","LWG", "``barrier``’s phase 
completion guarantees","February 

[llvm] [flang] [libcxx] [mlir] [clang] [lld] [compiler-rt] [libc] [libc++][complex] P2819R2: Add `tuple` protocol to `complex` (PR #79744)

2024-01-30 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/79744
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libc] [libcxx] [lld] [llvm] [mlir] [compiler-rt] [flang] [clang] [libc++][complex] P2819R2 - Add `tuple` protocol to `complex` (PR #79744)

2024-01-29 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79744

>From 52cdb5a5ae4ad33bb16dfe05738d64ee568a24ce Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sat, 27 Jan 2024 21:12:16 +0200
Subject: [PATCH] [libc++][complex] P2819R2 - Add `tuple` protocol to `complex`

Implements: P2819R2 
- https://eel.is/c++draft/utilities#concept:tuple-like
- https://eel.is/c++draft/complex.syn
- https://eel.is/c++draft/complex.tuple
---
 libcxx/docs/ReleaseNotes/19.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 libcxx/include/__fwd/complex.h|  25 +++
 libcxx/include/__fwd/get.h|  17 +++
 libcxx/include/__tuple/tuple_like.h   |   8 +
 libcxx/include/complex| 142 ++
 libcxx/include/libcxx.imp |   1 +
 libcxx/include/module.modulemap.in|   2 +
 libcxx/modules/std/complex.inc|   7 +
 .../tuple/__tuple_like.compile.pass.cpp   |  76 ++
 .../complex.number/complex.tuple/get.pass.cpp |  87 +++
 .../complex.tuple/get.verify.cpp  |  60 
 .../tuple_element.compile.pass.cpp|  43 ++
 .../complex.tuple/tuple_element.verify.cpp|  31 
 .../complex.tuple/tuple_size.compile.pass.cpp |  39 +
 .../generate_feature_test_macro_components.py |   2 +-
 17 files changed, 542 insertions(+), 2 deletions(-)
 create mode 100644 libcxx/include/__fwd/complex.h
 create mode 100644 
libcxx/test/libcxx/utilities/tuple/__tuple_like.compile.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/complex.number/complex.tuple/get.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/complex.number/complex.tuple/get.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index 17a0415a8ad43..c9faa6f9d456c 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -38,6 +38,7 @@ What's New in Libc++ 19.0.0?
 Implemented Papers
 --
 - P2637R3 - Member ``visit``
+- P2819R2 - Add ``tuple`` protocol to ``complex``
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index a62faee4f44e2..1c895f79a4c0f 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -39,7 +39,7 @@
 "`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2871R3 `__","LWG","Remove Deprecated Unicode 
Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
-"`P2819R2 `__","LWG","Add tuple protocol to 
complex","Kona November 2023","","",""
+"`P2819R2 `__","LWG","Add tuple protocol to 
complex","Kona November 2023","|Complete|","19.0",""
 "`P2937R0 `__","LWG","Freestanding: Remove 
``strtok``","Kona November 2023","","",""
 "`P2833R2 `__","LWG","Freestanding Library: inout 
expected span","Kona November 2023","","",""
 "`P2836R1 `__","LWG","``std::basic_const_iterator`` 
should follow its underlying type's convertibility","Kona November 
2023","","","|DR|"
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index ed721d467e94f..05332a3507d07 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -426,6 +426,7 @@ set(files
   __functional/weak_result_type.h
   __fwd/array.h
   __fwd/bit_reference.h
+  __fwd/complex.h
   __fwd/fstream.h
   __fwd/get.h
   __fwd/hash.h
diff --git a/libcxx/include/__fwd/complex.h b/libcxx/include/__fwd/complex.h
new file mode 100644
index 0..1c7be5a5ff750
--- /dev/null
+++ b/libcxx/include/__fwd/complex.h
@@ -0,0 +1,25 @@
+//===-===//
+//
+// 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
+//
+//===-===//
+
+#ifndef _LIBCPP___FWD_COMPLEX_H
+#define _LIBCPP___FWD_COMPLEX_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+

[libunwind] [llvm] [libcxx] [lld] [libc] [mlir] [flang] [compiler-rt] [clang] [clang-tools-extra] [lldb] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-29 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] [llvm] [libcxx] [libc] [clang-tools-extra] [lldb] [libc++][ranges] LWG4001: `iota_view` should provide `empty` (PR #79687)

2024-01-27 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79687

>From 87fe530b0a6afffb041f727ce261affc59d39d50 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 10:04:20 +0200
Subject: [PATCH 1/3] [libc++][ranges] LWG4001: `iota_view` should provide
 `empty`

Implements: https://wg21.link/LWG4001
- https://eel.is/c++draft/range.iota.view
---
 libcxx/docs/Status/Cxx2cIssues.csv|   2 +-
 libcxx/include/__ranges/iota_view.h   |   2 +
 .../range.iota.view/empty.pass.cpp| 136 ++
 3 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100644 
libcxx/test/std/ranges/range.factories/range.iota.view/empty.pass.cpp

diff --git a/libcxx/docs/Status/Cxx2cIssues.csv 
b/libcxx/docs/Status/Cxx2cIssues.csv
index b69b0948325412d..6401c7c6d8fc7d2 100644
--- a/libcxx/docs/Status/Cxx2cIssues.csv
+++ b/libcxx/docs/Status/Cxx2cIssues.csv
@@ -38,7 +38,7 @@
 "`3974 `__","``mdspan::operator[]`` should not copy 
``OtherIndexTypes``","Kona November 2023","","",""
 "`3987 `__","Including  doesn't 
provide ``std::begin``/``end``","Kona November 2023","","","|flat_containers|"
 "`3990 `__","Program-defined specializations of 
``std::tuple`` and ``std::variant`` can't be properly supported","Kona November 
2023","","",""
-"`4001 `__","``iota_view`` should provide 
``empty``","Kona November 2023","","","|ranges|"
+"`4001 `__","``iota_view`` should provide 
``empty``","Kona November 2023","|Complete|","19.0","|ranges|"
 "","","","","",""
 "`3343 `__","Ordering of calls to ``unlock()`` and 
``notify_all()`` in Effects element of ``notify_all_at_thread_exit()`` should 
be reversed","Not Yet Adopted","|Complete|","16.0",""
 "","","","","",""
diff --git a/libcxx/include/__ranges/iota_view.h 
b/libcxx/include/__ranges/iota_view.h
index c8314dd848b4473..6c5923c7ef013c2 100644
--- a/libcxx/include/__ranges/iota_view.h
+++ b/libcxx/include/__ranges/iota_view.h
@@ -345,6 +345,8 @@ class iota_view : public view_interface> {
 return __iterator{__bound_sentinel_};
   }
 
+  _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { return __value_ == 
__bound_sentinel_; }
+
   _LIBCPP_HIDE_FROM_ABI constexpr auto size() const
 requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||
 (integral<_Start> && integral<_BoundSentinel>) || 
sized_sentinel_for<_BoundSentinel, _Start>
diff --git 
a/libcxx/test/std/ranges/range.factories/range.iota.view/empty.pass.cpp 
b/libcxx/test/std/ranges/range.factories/range.iota.view/empty.pass.cpp
new file mode 100644
index 000..e7adffaf63b4c91
--- /dev/null
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/empty.pass.cpp
@@ -0,0 +1,136 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// constexpr bool empty() const;
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "types.h"
+
+template 
+concept HasFreeEmpty = requires(R r) { std::ranges::empty(r); };
+
+template 
+concept HasMemberEmpty = requires(R r) {
+  { r.empty() } -> std::same_as;
+};
+
+constexpr void test_empty_iota() {
+  std::vector ev;
+
+  // Both parameters are non-const
+  {
+auto iv = std::views::iota(std::ranges::begin(ev), std::ranges::end(ev));
+
+static_assert(HasFreeEmpty);
+static_assert(HasMemberEmpty);
+
+assert(iv.empty());
+  }
+  // Left paramter is const
+  {
+auto iv = std::views::iota(std::ranges::begin(std::as_const(ev)), 
std::ranges::end(ev));
+
+static_assert(HasFreeEmpty);
+static_assert(HasMemberEmpty);
+
+assert(iv.empty());
+  }
+  // Right paramter is const
+  {
+auto iv = std::views::iota(std::ranges::begin(ev), 
std::ranges::end(std::as_const(ev)));
+
+static_assert(HasFreeEmpty);
+static_assert(HasMemberEmpty);
+
+assert(iv.empty());
+  }
+  // Both parameters are const
+  {
+auto iv = std::views::iota(std::ranges::begin(std::as_const(ev)), 
std::ranges::end(std::as_const(ev)));
+
+static_assert(HasFreeEmpty);
+static_assert(HasMemberEmpty);
+
+assert(iv.empty());
+  }
+
+  std::vector v{'b', 'a', 'b', 'a', 'z', 'm', 't'};
+  auto fv = v | std::views::filter([](auto val) { return val == '0'; });
+
+  {
+auto iv = std::views::iota(std::ranges::begin(fv), std::ranges::end(fv));
+
+static_assert(HasFreeEmpty);
+static_assert(HasMemberEmpty);
+
+assert(iv.empty());
+  }
+}
+
+constexpr void test_nonempty_iota() {
+  // Default ctr
+  {
+

[compiler-rt] [mlir] [llvm] [flang] [clang] [clang-tools-extra] [libunwind] [libc] [lld] [libcxx] [lldb] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-27 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

> I tried this branch on our Windows builders although I'm not sure if it's 
> related or not to this patch:
> 
> ```
> # COMPILED WITH
> C:/b/s/w/ir/x/w/llvm_build/./bin/clang-cl.exe 
> C:\b\s\w\ir\x\w\github-H-G-Hristov-llvm-project\libcxx\test\libcxx\fuzzing\random.pass.cpp
>  --driver-mode=g++ --target=x86_64-pc-windows-msvc -fms-runtime-lib=static 
> -nostdinc++ -I C:/b/s/w/ir/x/w/llvm_build/include/c++/v1 -I 
> C:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -I 
> C:/b/s/w/ir/x/w/github-H-G-Hristov-llvm-project/libcxx/test/support 
> -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++26 -Werror -Wall 
> -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template 
> -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move 
> -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier 
> -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals 
> -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter 
> -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args 
> -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed 
> -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move 
> -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL 
> -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety 
> -Wuser-defined-warnings  -llibc++experimental -nostdlib -L 
> C:/b/s/w/ir/x/w/llvm_build/./lib/x86_64-pc-windows-msvc -llibc++ -llibcpmt -o 
> C:\b\s\w\ir\x\w\llvm_build\runtimes\runtimes-x86_64-pc-windows-msvc-bins\test\libcxx\fuzzing\Output\random.pass.cpp.dir\t.tmp.exe
> # executed command: C:/b/s/w/ir/x/w/llvm_build/./bin/clang-cl.exe 
> 'C:\b\s\w\ir\x\w\github-H-G-Hristov-llvm-project\libcxx\test\libcxx\fuzzing\random.pass.cpp'
>  --driver-mode=g++ --target=x86_64-pc-windows-msvc -fms-runtime-lib=static 
> -nostdinc++ -I C:/b/s/w/ir/x/w/llvm_build/include/c++/v1 -I 
> C:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -I 
> C:/b/s/w/ir/x/w/github-H-G-Hristov-llvm-project/libcxx/test/support 
> -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++26 -Werror -Wall 
> -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template 
> -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move 
> -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier 
> -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals 
> -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter 
> -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args 
> -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed 
> -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move 
> -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL 
> -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety 
> -Wuser-defined-warnings -llibc++experimental -nostdlib -L 
> C:/b/s/w/ir/x/w/llvm_build/./lib/x86_64-pc-windows-msvc -llibc++ -llibcpmt -o 
> 'C:\b\s\w\ir\x\w\llvm_build\runtimes\runtimes-x86_64-pc-windows-msvc-bins\test\libcxx\fuzzing\Output\random.pass.cpp.dir\t.tmp.exe'
> # .---command stderr
> # | In file included from 
> C:\b\s\w\ir\x\w\github-H-G-Hristov-llvm-project\libcxx\test\libcxx\fuzzing\random.pass.cpp:16:
> # | In file included from C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\cmath:319:
> # | In file included from 
> C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\math.h:301:
> # | In file included from C:\b\s\w\ir\cache\windows_sdk\Windows 
> Kits\10\Include\10.0.19041.0\ucrt\math.h:11:
> # | C:\b\s\w\ir\cache\windows_sdk\Windows 
> Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h:413:16: error: call to 
> 'fpclassify' is ambiguous
> # |   413 | return fpclassify(_X) == FP_NAN;
> # |   |^~
> # | 
> C:\b\s\w\ir\x\w\github-H-G-Hristov-llvm-project\libcxx\test\libcxx\fuzzing\random.pass.cpp:166:12:
>  note: in instantiation of function template specialization 'isnan' 
> requested here
> # |   166 |   if (std::isnan(res)) {
> # |   |^
> # | 
> C:\b\s\w\ir\x\w\github-H-G-Hristov-llvm-project\libcxx\test\libcxx\fuzzing\random.pass.cpp:178:10:
>  note: in instantiation of function template specialization 
> 'helper>' requested here
> # |   178 |   return 
> helper>(data, size)   ||
> # |   |  ^
> # | C:\b\s\w\ir\cache\windows_sdk\Windows 
> Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h:288:31: note: candidate 
> function
> # |   288 | _Check_return_ inline int fpclassify(_In_ float _X) throw()
> # |   |   ^
> # | C:\b\s\w\ir\cache\windows_sdk\Windows 
> Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h:293:31: note: candidate 
> function
> # |   293 | _Check_return_ inline int fpclassify(_In_ double _X) throw()
> # |   | 

[flang] [clang] [mlir] [llvm] [libcxx] [lld] [libc] [libunwind] [clang-tools-extra] [compiler-rt] [lldb] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-26 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/6] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[flang] [lldb] [lld] [clang-tools-extra] [libunwind] [llvm] [mlir] [compiler-rt] [libcxx] [clang] [libc] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-26 Thread Hristo Hristov via cfe-commits

Zingam wrote:

@petrhosek According to the log, the tests in this patch pass. Could you please 
try again. I'll wait a while and if there is not negative feedback I'll reland 
the patch.

> https://logs.chromium.org/logs/fuchsia/led/phosek_google.com/62644843c966785c9dedf065a79d80df8734b4df5ff7703ea3c2a2b5643cec05/+/u/clang/test/stdout
>  is the full log.

```
 PASS: llvm-libc++-static-clangcl.cfg.in :: 
std/utilities/format/format.arguments/format.arg/visit.pass.cpp (8505 of 9639)
 PASS: llvm-libc++-static-clangcl.cfg.in :: 
std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp 
(8506 of 9639)
 PASS: llvm-libc++-static-clangcl.cfg.in :: 
std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp 
(8537 of 9639)
 PASS: llvm-libc++-static-clangcl.cfg.in :: 
std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp
 (8439 of 9639)
```



https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [lldb] [lld] [clang-tools-extra] [libunwind] [llvm] [mlir] [compiler-rt] [libcxx] [clang] [libc] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-26 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/6] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[clang] [libcxx] [flang] [lld] [libunwind] [libc] [compiler-rt] [lldb] [clang-tools-extra] [llvm] [mlir] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-26 Thread Hristo Hristov via cfe-commits

Zingam wrote:

@petrhosek It is not related. It was supposedly fixed by this: 
https://github.com/llvm/llvm-project/pull/79619
I've been observing the chromium Windows CI failing for a while. Let's see if 
the above patch fixes it. I'll rebase now this one now.

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [lldb] [libcxx] [libc] [clang] [lld] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/6] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a517..237a63022d55ff5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f045..c45aa3c510072e4 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca6..6e58e752191ea5d 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d9..00489d971c296c2 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libunwind] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [lldb] [libcxx] [libc] [clang] [lld] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/6] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libunwind] [clang-tools-extra] [libc] [clang] [lld] [mlir] [lldb] [compiler-rt] [libcxx] [llvm] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/5] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libunwind] [clang-tools-extra] [libc] [clang] [lld] [mlir] [lldb] [compiler-rt] [libcxx] [llvm] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/4] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libunwind] [clang-tools-extra] [libc] [clang] [lld] [mlir] [lldb] [compiler-rt] [libcxx] [llvm] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/3] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a517..237a63022d55ff5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f045..c45aa3c510072e4 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca6..6e58e752191ea5d 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d9..00489d971c296c2 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[llvm] [libcxx] [flang] [compiler-rt] [lld] [libc] [lldb] [clang-tools-extra] [clang] [mlir] [libunwind] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/2] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libc] [flang] [libunwind] [libcxx] [clang-tools-extra] [compiler-rt] [lldb] [clang] [llvm] [mlir] [lld] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-25 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/2] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a51..237a63022d55ff 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f04..c45aa3c510072e 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca..6e58e752191ea5 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d..00489d971c296c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[libc] [compiler-rt] [libunwind] [flang] [lldb] [libcxx] [lld] [clang] [llvm] [clang-tools-extra] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits


@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""

H-G-Hristov wrote:

```suggestion
"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","19.0",""
```

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libc] [lld] [lldb] [libunwind] [libcxx] [compiler-rt] [llvm] [clang-tools-extra] [flang] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits


@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0

H-G-Hristov wrote:

```suggestion
"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",19.0
```

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [libunwind] [clang] [lld] [clang-tools-extra] [flang] [lldb] [libcxx] [libc] [compiler-rt] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits


@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list

H-G-Hristov wrote:

```suggestion
- P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
- P2447R6 - ``span`` over initializer list
```

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [flang] [compiler-rt] [lldb] [libc] [clang] [libcxx] [libunwind] [llvm] [lld] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [flang] [clang] [lld] [libc] [libcxx] [lldb] [clang-tools-extra] [compiler-rt] [libunwind] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov commented:

@mordante I guess the PR missed LLVM18 release. I'll update the release notes 
accordingly. Is that OK?

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [libcxx] [libc] [clang] [clang-tools-extra] [libunwind] [compiler-rt] [lld] [flang] [llvm] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

I noticed some of clang-cl test crashed. I rebased again.

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [libcxx] [libc] [clang] [clang-tools-extra] [libunwind] [compiler-rt] [lld] [flang] [llvm] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/2] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a517..237a63022d55ff5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f045..c45aa3c510072e4 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca6..6e58e752191ea5d 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d9..00489d971c296c2 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[llvm] [clang] [flang] [compiler-rt] [libcxx] [clang-tools-extra] [libc] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

> @H-G-Hristov Would it be possible to update your branch? I sent it to our 
> Windows builders but Clang is segfaulting while building runtimes.

Thank you for taking a look. I updated the branch. Please note that pre-release 
Clang 18 used to have a bug related to "deducing this", which is used by this 
feature. It has been rectified since then: 
https://github.com/llvm/llvm-project/pull/75913
The other patch related to this paper seems to have passed the CI: 
https://github.com/llvm/llvm-project/pull/76449

https://github.com/llvm/llvm-project/pull/79032
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [clang] [llvm] [libc] [libcxx] [flang] [clang-tools-extra] Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (PR #79032)

2024-01-24 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/79032

>From e03452fda84a5284420bba1913299b68caabb6cd Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Mon, 22 Jan 2024 20:35:00 +0200
Subject: [PATCH 1/2] Revert "Revert "[libc++][format] P2637R3: Member `visit`
 (`std::basic_format_arg`) (#76449)""

This reverts commit 02f95b77515fe18ed1076b94cbb850ea0cf3c77e.
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/docs/Status/FormatIssues.csv   |   2 +-
 libcxx/include/__config   |   6 +
 libcxx/include/__format/format_arg.h  | 109 +-
 libcxx/include/__format/format_context.h  |  33 +-
 libcxx/include/format |   2 +-
 .../format.arg/visit.pass.cpp | 333 
 .../format.arg/visit.return_type.pass.cpp | 369 ++
 .../visit_format_arg.deprecated.verify.cpp|  38 ++
 .../format.arg/visit_format_arg.pass.cpp  |   6 +-
 .../format.arguments/format.args/get.pass.cpp |  48 ++-
 libcxx/test/support/test_basic_format_arg.h   |  20 +-
 libcxx/test/support/test_macros.h |   5 +
 .../generate_feature_test_macro_components.py |   1 +
 15 files changed, 927 insertions(+), 48 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp
 create mode 100644 
libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index fd882bafe19a517..237a63022d55ff5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -79,6 +79,7 @@ Implemented Papers
 - P1759R6 - Native handles and file streams
 - P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2637R3 - Member ``visit``
 - P2447R6 - ``span`` over initializer list
 
 
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index f80b1f6b663f045..c45aa3c510072e4 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -17,7 +17,7 @@
 "`P0792R14 `__","LWG","``function_ref``: a 
type-erased callable reference","Varna June 2023","","",""
 "`P2874R2 `__","LWG","Mandating Annex D Require No 
More","Varna June 2023","","",""
 "`P2757R3 `__","LWG","Type-checking format 
args","Varna June 2023","","","|format|"
-"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Partial|","18.0",""
+"`P2637R3 `__","LWG","Member ``visit``","Varna June 
2023","|Complete|","18.0",""
 "`P2641R4 `__","CWG, LWG","Checking if a ``union`` 
alternative is active","Varna June 2023","","",""
 "`P1759R6 `__","LWG","Native handles and file 
streams","Varna June 2023","|Complete|","18.0",""
 "`P2697R1 `__","LWG","Interfacing ``bitset`` with 
``string_view``","Varna June 2023","|Complete|","18.0",""
diff --git a/libcxx/docs/Status/FormatIssues.csv 
b/libcxx/docs/Status/FormatIssues.csv
index 513988d08036ca6..6e58e752191ea5d 100644
--- a/libcxx/docs/Status/FormatIssues.csv
+++ b/libcxx/docs/Status/FormatIssues.csv
@@ -16,7 +16,7 @@ Number,Name,Standard,Assignee,Status,First released version
 "`P2693R1 `__","Formatting ``thread::id`` and 
``stacktrace``","C++23","Mark de Wever","|In Progress|"
 "`P2510R3 `__","Formatting pointers","C++26","Mark 
de Wever","|Complete|",17.0
 "`P2757R3 `__","Type-checking format 
args","C++26","","",
-"`P2637R3 `__","Member ``visit``","C++26","","",
+"`P2637R3 `__","Member ``visit``","C++26","Hristo 
Hristov","|Complete|",18.0
 "`P2905R2 `__","Runtime format strings","C++26 
DR","Mark de Wever","|Complete|",18.0
 "`P2918R2 `__","Runtime format strings 
II","C++26","Mark de Wever","|Complete|",18.0
 "`P2909R4 `__","Fix formatting of code units as 
integers (Dude, where’s my ``char``?)","C++26 DR","Mark de 
Wever","|Complete|",18.0
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 9a64cdb489119d9..00489d971c296c2 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -995,6 +995,12 @@ typedef __char32_t char32_t;
 #define _LIBCPP_DEPRECATED_IN_CXX23
 #  endif
 
+#  if _LIBCPP_STD_VER >= 26
+#define _LIBCPP_DEPRECATED_IN_CXX26 _LIBCPP_DEPRECATED
+#  else
+#define _LIBCPP_DEPRECATED_IN_CXX26
+#  endif
+
 #  if 

[lld] [flang] [mlir] [libcxx] [libc] [openmp] [compiler-rt] [clang] [lldb] [llvm] [clang-tools-extra] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-22 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

> This is still broken so I'm going to revert the change.

Thanks! Sorry for the inconvenience. I didn't see your message earlier.

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [lld] [flang] [compiler-rt] [mlir] [libc] [libunwind] [openmp] [polly] [llvm] [libcxxabi] [lldb] [clang] [clang-tools-extra] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [lld] [clang] [libunwind] [polly] [libc] [llvm] [compiler-rt] [lldb] [clang-tools-extra] [libcxx] [mlir] [libcxxabi] [openmp] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov ready_for_review 
https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [lld] [libcxxabi] [llvm] [flang] [libc] [compiler-rt] [libunwind] [openmp] [lldb] [clang] [mlir] [polly] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

There is a problem with the test. Working on it.

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [lld] [mlir] [libcxx] [libunwind] [lldb] [compiler-rt] [clang-tools-extra] [clang] [libcxxabi] [openmp] [llvm] [libc] [polly] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov converted_to_draft 
https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [mlir] [clang-tools-extra] [openmp] [lld] [libc] [libcxxabi] [flang] [libunwind] [polly] [compiler-rt] [llvm] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,458 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+// The test uses "Placeholder variables with no name"
+// UNSUPPORTED: clang-17
+// XFAIL: apple-clang
+
+// 
+
+// template
+//   constexpr R saturate_cast(T x) noexcept; // 
freestanding
+
+#include 
+#include 
+#include 
+#include 
+
+#include "test_macros.h"
+
+// Smaller to larger
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+// Same type
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+// Larger to smaller
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+template 
+constexpr auto zero() {
+  return IntegerT{0};
+}
+
+constexpr bool test() {
+  // clang-format off
+
+#ifndef TEST_HAS_NO_INT128
+  using SIntT = __int128_t;
+  using UIntT = __uint128_t;
+#else
+  using SIntT = long long int;
+  using UIntT = unsigned long long int;
+#endif
+
+  // Constants: biggest numbers
+
+  constexpr auto big_sintMin  = std::numeric_limits::min();
+  constexpr auto big_sintZero =zero();
+  constexpr auto big_sintMax  = std::numeric_limits::max();
+
+  constexpr auto big_uintMin  = std::numeric_limits::min();
+  constexpr auto big_uintZero =zero();
+  constexpr auto big_uintMax  = std::numeric_limits::max();
+
+  // Constants: numeric limits
+
+  constexpr auto std_scharMin  = std::numeric_limits::min();
+  constexpr auto std_scharZero =zero();
+  constexpr auto std_scharMax  = std::numeric_limits::max();
+
+  constexpr auto std_ucharMin  = std::numeric_limits::min();
+  constexpr auto std_ucharZero =zero();
+  constexpr auto std_ucharMax  = std::numeric_limits::max();
+
+  constexpr auto std_ssintMin  = std::numeric_limits::min();
+  constexpr auto std_ssintZero =zero();
+  constexpr auto std_ssintMax  = std::numeric_limits::max();
+
+  constexpr auto std_usintMin  = std::numeric_limits::min();
+  constexpr auto std_usintZero =zero();
+  constexpr auto std_usintMax  = std::numeric_limits::max();
+
+  constexpr auto std_sintMin   = std::numeric_limits::min();
+  constexpr auto std_sintZero  =zero();
+  constexpr auto std_sintMax   = std::numeric_limits::max();
+
+  constexpr auto std_uintMin   = std::numeric_limits::min();
+  constexpr auto std_uintZero  =zero();
+  constexpr auto std_uintMax   = std::numeric_limits::max();
+
+  constexpr auto std_slMin = std::numeric_limits::min();
+  constexpr auto std_slZero=zero();
+  constexpr auto std_slMax = std::numeric_limits::max();
+
+  constexpr auto std_ulMin = std::numeric_limits::min();
+  constexpr auto std_ulZero=zero();
+  constexpr auto std_ulMax = std::numeric_limits::max();
+
+  constexpr auto std_sllMin= std::numeric_limits::min();
+  constexpr auto std_sllZero   =zero();
+  constexpr auto std_sllMax= std::numeric_limits::max();
+
+  constexpr auto std_ullMin= std::numeric_limits::min();
+  constexpr auto std_ullZero   =zero();
+  constexpr auto std_ullMax= std::numeric_limits::max();
+  
+  // signed char
+
+  assert(std::saturate_cast(std_scharMin)  == std_scharMin);
+  assert(std::saturate_cast(std_scharZero) == std_scharZero);
+  assert(std::saturate_cast(std_scharMax)  == std_scharMax);
+
+  assert(std::saturate_cast(std_ucharMin)  == std_scharZero);
+  assert(std::saturate_cast(std_ucharZero) == std_scharZero);
+  assert(std::saturate_cast(std_ucharMax)  == std_scharMax);
+
+  assert(std::saturate_cast(big_sintMin)   == std_scharMin);  // 
saturated
+  assert(std::saturate_cast(big_sintZero)  == std_scharZero);
+  assert(std::saturate_cast(big_sintMax)   == std_scharMax);  // 
saturated
+
+  assert(std::saturate_cast(big_uintMin)   == std_scharZero);
+  assert(std::saturate_cast(big_uintZero)  == std_scharZero);
+  assert(std::saturate_cast(big_uintMax)   == std_scharMax);  // 
saturated
+
+  // short
+
+  std::same_as decltype(auto) _ = 

[clang] [lldb] [mlir] [clang-tools-extra] [openmp] [lld] [libc] [libcxxabi] [flang] [libunwind] [polly] [compiler-rt] [llvm] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,458 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+// The test uses "Placeholder variables with no name"
+// UNSUPPORTED: clang-17
+// XFAIL: apple-clang
+
+// 
+
+// template
+//   constexpr R saturate_cast(T x) noexcept; // 
freestanding
+
+#include 
+#include 
+#include 
+#include 
+
+#include "test_macros.h"
+
+// Smaller to larger
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+// Same type
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+// Larger to smaller
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+static_assert(noexcept(std::saturate_cast(std::numeric_limits::max(;
+
+template 
+constexpr auto zero() {
+  return IntegerT{0};
+}
+
+constexpr bool test() {
+  // clang-format off
+
+#ifndef TEST_HAS_NO_INT128
+  using SIntT = __int128_t;
+  using UIntT = __uint128_t;
+#else
+  using SIntT = long long int;
+  using UIntT = unsigned long long int;
+#endif
+
+  // Constants: biggest numbers
+
+  constexpr auto big_sintMin  = std::numeric_limits::min();
+  constexpr auto big_sintZero =zero();
+  constexpr auto big_sintMax  = std::numeric_limits::max();

H-G-Hristov wrote:

These are needed specifically as these values can vary but I used the C integer 
constants wherever applicable.

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] [openmp] [libc] [flang] [mlir] [libcxxabi] [polly] [libcxx] [lldb] [lld] [clang] [compiler-rt] [clang-tools-extra] [llvm] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov ready_for_review 
https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [lld] [llvm] [libcxx] [openmp] [flang] [libunwind] [libcxxabi] [compiler-rt] [clang-tools-extra] [polly] [libc] [clang] [mlir] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-21 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

I did some re-imagining of the tests, there is a some redundancy but it is 
cleared that nothing was missed.
I also used the Clang 18's "Placeholder variables with no name" to make the 
test a bit cleaner, so I disabled the unsupported compilers.
The tests are formatted in tabular form manually to make them easier to read.

If the above is unacceptable, it can be fixed easily. For now it makes it 
easier to read and review. 

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [lldb] [mlir] [flang] [lld] [libcxx] [llvm] [openmp] [clang-tools-extra] [libc] [clang] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-21 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [clang] [llvm] [clang-tools-extra] [lldb] [lld] [openmp] [compiler-rt] [libc] [mlir] [libcxx] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/76447
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [clang] [llvm] [clang-tools-extra] [lldb] [lld] [openmp] [compiler-rt] [libc] [mlir] [libcxx] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Hristo Hristov via cfe-commits

Zingam wrote:

The FreeBSD CI failure is unrelated and should be fixed upstream. Merging.

https://github.com/llvm/llvm-project/pull/76447
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [lld] [libcxx] [openmp] [llvm] [clang-tools-extra] [flang] [clang] [mlir] [libc] [lldb] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

@mordante Could you please have another look at the test/latest update.

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[openmp] [libc] [mlir] [lld] [llvm] [clang] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libcxx] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Hristo Hristov via cfe-commits


@@ -1513,6 +1519,11 @@ 
__sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
 #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
 #  endif
 
+// Clang-18 has support for deducing this, but it does not set the FTM.
+#if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER ) 
&&_LIBCPP_CLANG_VER >= 1800)
+#  define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+#endif
+

H-G-Hristov wrote:

Of course!

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[openmp] [libc] [mlir] [lld] [llvm] [clang] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libcxx] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,357 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+// The tested functionality needs deducing this.
+// UNSUPPORTED: clang-16 || clang-17 || apple-clang
+
+// 
+
+// class variant;
+
+// template
+//   constexpr R visit(this Self&&, Visitor&&);  // since C++26
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "test_macros.h"
+#include "variant_test_helpers.h"
+
+template 
+struct overloaded : Ts... {
+  using Ts::operator()...;
+};
+
+void test_overload_ambiguity() {
+  using V = std::variant;
+  using namespace std::string_literals;
+  V v{"baba"s};
+
+  v.visit(
+  overloaded{[]([[maybe_unused]] auto x) { assert(false); }, [](const 
std::string& x) { assert(x == "baba"s); }});
+  assert(std::get(v) == "baba"s);
+
+  // Test the constraint.
+  v = std::move(v).visit(overloaded{
+  []([[maybe_unused]] auto x) {
+assert(false);
+return 0;
+  },
+  [](const std::string& x) {
+assert(x == "baba"s);
+return x + " zmt"s;
+  }});
+  assert(std::get(v) == "baba zmt"s);
+}
+
+template 
+void test_call_operator_forwarding() {
+  using Fn = ForwardingCallObject;
+  Fn obj{};
+  const Fn& cobj = obj;
+
+  { // test call operator forwarding - no variant
+// non-member
+{
+  std::visit(obj);
+  assert(Fn::check_call<>(CT_NonConst | CT_LValue));
+  std::visit(cobj);
+  assert(Fn::check_call<>(CT_Const | CT_LValue));
+  std::visit(std::move(obj));
+  assert(Fn::check_call<>(CT_NonConst | CT_RValue));
+  std::visit(std::move(cobj));
+  assert(Fn::check_call<>(CT_Const | CT_RValue));
+}

H-G-Hristov wrote:

Good catch! Thank you!

https://github.com/llvm/llvm-project/pull/76447
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lld] [mlir] [clang] [llvm] [libcxx] [openmp] [libc] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

This FreeBSD failure seems unrelated, the same appears in `variant`:

```
# .---command stderr
# | In file included from 
/usr/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/libcxx/assertions/modes/override_with_fast_mode.pass.cpp:19:
# | 
/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/support/check_assertion.h:293:25:
 error: use of undeclared identifier 'SIGILL'
# |   if (exit_code_ == SIGILL || exit_code_ == SIGTRAP) {
# | ^
# | 
/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/support/check_assertion.h:293:49:
 error: use of undeclared identifier 'SIGTRAP'
# |   if (exit_code_ == SIGILL || exit_code_ == SIGTRAP) {
# | ^
# | 2 errors generated.
# `-
# error: command failed with exit status: 1

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lld] [clang] [llvm] [libcxx] [openmp] [libc] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

This FreeBSD failure seems unrelated:
```
# .---command stderr
# | In file included from 
/usr/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/std/algorithms/numeric.ops/transform.reduce/pstl.exception_handling.pass.cpp:20:
# | 
/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/support/check_assertion.h:293:25:
 error: use of undeclared identifier 'SIGILL'
# |   if (exit_code_ == SIGILL || exit_code_ == SIGTRAP) {
# | ^
# | 
/home/buildkite/.buildkite-agent/builds/freebsd-test-1/llvm-project/libcxx-ci/libcxx/test/support/check_assertion.h:293:49:
 error: use of undeclared identifier 'SIGTRAP'
# |   if (exit_code_ == SIGILL || exit_code_ == SIGTRAP) {
# | ^
# | 2 errors generated.
# `-
# error: command failed with exit status: 1
```

https://github.com/llvm/llvm-project/pull/76447
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] [libc] [mlir] [clang-tools-extra] [openmp] [libcxx] [compiler-rt] [lldb] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-19 Thread Hristo Hristov via cfe-commits


@@ -144,7 +144,8 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) 
__visit_format_arg(_Visitor&& __vis, basic_
   __libcpp_unreachable();
 }
 
-#  if _LIBCPP_STD_VER >= 26
+#  if _LIBCPP_STD_VER >= 26 && (!defined(_LIBCPP_COMPILER_CLANG_BASED) || 
_LIBCPP_CLANG_VER >= 1800)

H-G-Hristov wrote:

> I would go with with a new config variable 
> `_LIBCPP_HAS_EXPLICIT_THIS_PARAMETER`
> 
> ```
> // Clang-18 has support for deducing this, but it does not set the FTM.
> #if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER ) 
> &&_LIBCPP_CLANG_VER >= 1800))
> #  define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
> #endif
> ```
> 
> This allows to easily add AppleClang when they support it. For the library we 
> only support GCC and Clang based compilers.

Thank you! Done!

I think we also need to disable the test on Apple Clang, so I added:
`// UNSUPPORTED: clang-16 || clang-17 || apple-clang`

I hope this is the way.

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [libc] [libunwind] [lldb] [flang] [llvm] [libcxxabi] [compiler-rt] [libcxx] [libc++][span] P2447R4: `std::span` over an initializer list (PR #78157)

2024-01-19 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/78157
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [libc] [libunwind] [lldb] [polly] [flang] [llvm] [libcxxabi] [compiler-rt] [libcxx] [mlir] [libc++][any] LWG3305: `any_cast` (PR #78215)

2024-01-19 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/78215
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [openmp] [libc] [lldb] [lld] [flang] [llvm] [compiler-rt] [libcxx] [mlir] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562

2024-01-19 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/78562
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [lldb] [libcxxabi] [lld] [llvm] [libcxx] [clang] [polly] [clang-tools-extra] [libc] [mlir] [openmp] [compiler-rt] [libunwind] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov converted_to_draft 
https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] [openmp] [clang] [mlir] [lldb] [compiler-rt] [clang-tools-extra] [lld] [llvm] [libc] [flang] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78562

>From fadaafbf791d5fe78f6ac9ee3494b128339781ba Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 18 Jan 2024 09:47:40 +0200
Subject: [PATCH 1/6] [libc++][memory] P2868R1 - Removing deprecated typedef
 `std::allocator::is_always_equal`

Implements:
- https://wg21.link/P2868R1
- https://wg21.link/LWG3170
---
 libcxx/.clang-format  |  1 +
 libcxx/docs/ReleaseNotes/18.rst   |  1 +
 libcxx/docs/Status/Cxx23Issues.csv|  2 +-
 libcxx/docs/Status/Cxx2cPapers.csv|  2 +-
 libcxx/docs/UsingLibcxx.rst   |  4 ++
 libcxx/include/__memory/allocator.h   |  8 +++-
 libcxx/include/memory |  2 +-
 ...cator_types.deprecated_in_cxx23.verify.cpp | 44 +++
 .../allocator_types.pass.cpp  |  2 +
 ...llocator_types.removed_in_cxx26.verify.cpp | 34 ++
 10 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx23.verify.cpp
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx26.verify.cpp

diff --git a/libcxx/.clang-format b/libcxx/.clang-format
index 56bdf2b5f911659..39ae1322ffa8a63 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -28,6 +28,7 @@ AttributeMacros: [
   '_LIBCPP_DEPRECATED_IN_CXX14',
   '_LIBCPP_DEPRECATED_IN_CXX17',
   '_LIBCPP_DEPRECATED_IN_CXX20',
+  '_LIBCPP_DEPRECATED_IN_CXX23',
   '_LIBCPP_DEPRECATED',
   '_LIBCPP_DISABLE_EXTENTSION_WARNING',
   '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 77b7939a0c0ac96..3e2fb8727941d6b 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23Issues.csv 
b/libcxx/docs/Status/Cxx23Issues.csv
index b24ecc5525a1497..70480b338205804 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -15,7 +15,7 @@
 "`2743 `__","P0083R3 ``node_handle`` private 
members missing ""exposition only"" comment","November 2020","|Nothing To 
Do|",""
 "`2820 `__","Clarify  
macros","November 2020","|Nothing To Do|",""
 "`3120 `__","Unclear behavior of 
``monotonic_buffer_resource::release()``","November 2020","",""
-"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","",""
+"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","|Complete|","18.0"
 "`3036 `__","``polymorphic_allocator::destroy`` is 
extraneous","November 2020","",""
 "`3171 `__","LWG2989 breaks ``directory_entry`` 
stream insertion","November 2020","|Complete|","14.0"
 "`3306 `__","``ranges::advance`` violates its 
preconditions","November 2020","|Complete|","14.0","|ranges|"
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c6..762cbc6d487c69d 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -36,7 +36,7 @@
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
 "`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
-"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
+"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2871R3 `__","LWG","Remove Deprecated Unicode 
Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
 "`P2819R2 `__","LWG","Add tuple protocol to 

[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [clang-tools-extra] [openmp] [llvm] [lld] [compiler-rt] [mlir] [libc] [flang] [clang] [libcxx] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits


@@ -144,7 +144,8 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) 
__visit_format_arg(_Visitor&& __vis, basic_
   __libcpp_unreachable();
 }
 
-#  if _LIBCPP_STD_VER >= 26
+#  if _LIBCPP_STD_VER >= 26 && (!defined(_LIBCPP_COMPILER_CLANG_BASED) || 
_LIBCPP_CLANG_VER >= 1800)

H-G-Hristov wrote:

Maybe something like:

```c++
#  if _LIBCPP_STD_VER >= 26 && (defined(__cpp_explicit_this_parameter) || 
!defined(_LIBCPP_COMPILER_CLANG_BASED) || _LIBCPP_CLANG_VER >= 1800)
...
#endif
```
or 

```c++
#if defined(__cpp_explicit_this_parameter) || 
!defined(_LIBCPP_COMPILER_CLANG_BASED) || _LIBCPP_CLANG_VER >= 1800
#define _LIBCPP_EXPLICIT_THIS_PARAMETER
#endif
```

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov deleted 
https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits


@@ -24,14 +24,17 @@ void test(From value) {
   auto store = std::make_format_args(value);
   const std::basic_format_args format_args{store};
 
-  std::visit_format_arg(
-  [v = To(value)](auto a) {
-if constexpr (std::is_same_v)
-  assert(v == a);
-else
-  assert(false);
-  },
-  format_args.get(0));
+  auto visitor = [v = To(value)](auto a) {
+if constexpr (std::is_same_v)
+  assert(v == a);
+else
+  assert(false);
+  };
+#if _LIBCPP_STD_VER >= 26 && (!defined(TEST_COMPILER_CLANG) || TEST_CLANG_VER 
>= 1800)

H-G-Hristov wrote:

N.B. `TEST_CLANG_VER` is not defined for Apple Clang ???

```c++
#if defined(__apple_build_version__)
// Given AppleClang XX.Y.Z, TEST_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 
14.0.3 => 1403)
#define TEST_APPLE_CLANG_VER (__apple_build_version__ / 1)
#elif defined(__clang_major__)
#define TEST_CLANG_VER (__clang_major__ * 100) + __clang_minor__
#elif defined(__GNUC__)
// Given GCC XX.YY.ZZ, TEST_GCC_VER is XXYYZZ
#define TEST_GCC_VER ((__GNUC__ * 1) + (__GNUC_MINOR__ * 100) + 
__GNUC_PATCHLEVEL__)
#endif
```

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [compiler-rt] [clang-tools-extra] [libunwind] [libcxxabi] [flang] [libc] [llvm] [libc++][span] P2447R4: `std::span` over an initializer list (PR #78157)

2024-01-18 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

> > Thanks. The documentation build fails due to some CMake error consistently 
> > otherwise I believe I addressed all comments.
> > I think I fixed this a few days ago.
> 
> LGTM modulo 1 nit.

Thanx!

https://github.com/llvm/llvm-project/pull/78157
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [libcxx] [mlir] [openmp] [compiler-rt] [clang-tools-extra] [flang] [libc] [lld] [llvm] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

Thank you for the review!

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libc] [clang-tools-extra] [libcxx] [lldb] [flang] [clang] [mlir] [llvm] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562)

2024-01-18 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

Thank you for the review!

https://github.com/llvm/llvm-project/pull/78562
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [clang] [lldb] [lld] [clang-tools-extra] [mlir] [libc] [compiler-rt] [llvm] [libcxx] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-18 Thread Hristo Hristov via cfe-commits


@@ -144,7 +144,8 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) 
__visit_format_arg(_Visitor&& __vis, basic_
   __libcpp_unreachable();
 }
 
-#  if _LIBCPP_STD_VER >= 26
+#  if _LIBCPP_STD_VER >= 26 && (!defined(_LIBCPP_COMPILER_CLANG_BASED) || 
_LIBCPP_CLANG_VER >= 1800)

H-G-Hristov wrote:

https://clang.llvm.org/docs/ReleaseNotes.html

> Implemented P0847R7: Deducing this. Some related core issues were also 
> implemented (CWG2553, CWG2554, CWG2653, CWG2687). Because the support for 
> this feature is still experimental, the feature test macro 
> __cpp_explicit_this_parameter was not set in this version.

I'll revert the change.

https://github.com/llvm/llvm-project/pull/76449
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [libc] [mlir] [clang] [flang] [libcxx] [clang-tools-extra] [llvm] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78562

>From fadaafbf791d5fe78f6ac9ee3494b128339781ba Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 18 Jan 2024 09:47:40 +0200
Subject: [PATCH 1/5] [libc++][memory] P2868R1 - Removing deprecated typedef
 `std::allocator::is_always_equal`

Implements:
- https://wg21.link/P2868R1
- https://wg21.link/LWG3170
---
 libcxx/.clang-format  |  1 +
 libcxx/docs/ReleaseNotes/18.rst   |  1 +
 libcxx/docs/Status/Cxx23Issues.csv|  2 +-
 libcxx/docs/Status/Cxx2cPapers.csv|  2 +-
 libcxx/docs/UsingLibcxx.rst   |  4 ++
 libcxx/include/__memory/allocator.h   |  8 +++-
 libcxx/include/memory |  2 +-
 ...cator_types.deprecated_in_cxx23.verify.cpp | 44 +++
 .../allocator_types.pass.cpp  |  2 +
 ...llocator_types.removed_in_cxx26.verify.cpp | 34 ++
 10 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx23.verify.cpp
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx26.verify.cpp

diff --git a/libcxx/.clang-format b/libcxx/.clang-format
index 56bdf2b5f91165..39ae1322ffa8a6 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -28,6 +28,7 @@ AttributeMacros: [
   '_LIBCPP_DEPRECATED_IN_CXX14',
   '_LIBCPP_DEPRECATED_IN_CXX17',
   '_LIBCPP_DEPRECATED_IN_CXX20',
+  '_LIBCPP_DEPRECATED_IN_CXX23',
   '_LIBCPP_DEPRECATED',
   '_LIBCPP_DISABLE_EXTENTSION_WARNING',
   '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 77b7939a0c0ac9..3e2fb8727941d6 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23Issues.csv 
b/libcxx/docs/Status/Cxx23Issues.csv
index b24ecc5525a149..70480b33820580 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -15,7 +15,7 @@
 "`2743 `__","P0083R3 ``node_handle`` private 
members missing ""exposition only"" comment","November 2020","|Nothing To 
Do|",""
 "`2820 `__","Clarify  
macros","November 2020","|Nothing To Do|",""
 "`3120 `__","Unclear behavior of 
``monotonic_buffer_resource::release()``","November 2020","",""
-"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","",""
+"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","|Complete|","18.0"
 "`3036 `__","``polymorphic_allocator::destroy`` is 
extraneous","November 2020","",""
 "`3171 `__","LWG2989 breaks ``directory_entry`` 
stream insertion","November 2020","|Complete|","14.0"
 "`3306 `__","``ranges::advance`` violates its 
preconditions","November 2020","|Complete|","14.0","|ranges|"
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c..762cbc6d487c69 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -36,7 +36,7 @@
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
 "`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
-"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
+"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2871R3 `__","LWG","Remove Deprecated Unicode 
Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
 "`P2819R2 `__","LWG","Add tuple protocol to 
complex","Kona 

[mlir] [clang] [llvm] [lldb] [flang] [libcxx] [libc] [clang-tools-extra] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78562

>From fadaafbf791d5fe78f6ac9ee3494b128339781ba Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 18 Jan 2024 09:47:40 +0200
Subject: [PATCH 1/4] [libc++][memory] P2868R1 - Removing deprecated typedef
 `std::allocator::is_always_equal`

Implements:
- https://wg21.link/P2868R1
- https://wg21.link/LWG3170
---
 libcxx/.clang-format  |  1 +
 libcxx/docs/ReleaseNotes/18.rst   |  1 +
 libcxx/docs/Status/Cxx23Issues.csv|  2 +-
 libcxx/docs/Status/Cxx2cPapers.csv|  2 +-
 libcxx/docs/UsingLibcxx.rst   |  4 ++
 libcxx/include/__memory/allocator.h   |  8 +++-
 libcxx/include/memory |  2 +-
 ...cator_types.deprecated_in_cxx23.verify.cpp | 44 +++
 .../allocator_types.pass.cpp  |  2 +
 ...llocator_types.removed_in_cxx26.verify.cpp | 34 ++
 10 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx23.verify.cpp
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx26.verify.cpp

diff --git a/libcxx/.clang-format b/libcxx/.clang-format
index 56bdf2b5f911659..39ae1322ffa8a63 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -28,6 +28,7 @@ AttributeMacros: [
   '_LIBCPP_DEPRECATED_IN_CXX14',
   '_LIBCPP_DEPRECATED_IN_CXX17',
   '_LIBCPP_DEPRECATED_IN_CXX20',
+  '_LIBCPP_DEPRECATED_IN_CXX23',
   '_LIBCPP_DEPRECATED',
   '_LIBCPP_DISABLE_EXTENTSION_WARNING',
   '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 77b7939a0c0ac96..3e2fb8727941d6b 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23Issues.csv 
b/libcxx/docs/Status/Cxx23Issues.csv
index b24ecc5525a1497..70480b338205804 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -15,7 +15,7 @@
 "`2743 `__","P0083R3 ``node_handle`` private 
members missing ""exposition only"" comment","November 2020","|Nothing To 
Do|",""
 "`2820 `__","Clarify  
macros","November 2020","|Nothing To Do|",""
 "`3120 `__","Unclear behavior of 
``monotonic_buffer_resource::release()``","November 2020","",""
-"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","",""
+"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","|Complete|","18.0"
 "`3036 `__","``polymorphic_allocator::destroy`` is 
extraneous","November 2020","",""
 "`3171 `__","LWG2989 breaks ``directory_entry`` 
stream insertion","November 2020","|Complete|","14.0"
 "`3306 `__","``ranges::advance`` violates its 
preconditions","November 2020","|Complete|","14.0","|ranges|"
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c6..762cbc6d487c69d 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -36,7 +36,7 @@
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
 "`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
-"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
+"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2871R3 `__","LWG","Remove Deprecated Unicode 
Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
 "`P2819R2 `__","LWG","Add tuple protocol to 

[mlir] [clang] [llvm] [lldb] [flang] [libcxx] [libc] [clang-tools-extra] [libc++][memory] P2868R1: Removing deprecated typedef `std::allocator::is_always_equal` (PR #78562)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78562

>From fadaafbf791d5fe78f6ac9ee3494b128339781ba Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 18 Jan 2024 09:47:40 +0200
Subject: [PATCH 1/3] [libc++][memory] P2868R1 - Removing deprecated typedef
 `std::allocator::is_always_equal`

Implements:
- https://wg21.link/P2868R1
- https://wg21.link/LWG3170
---
 libcxx/.clang-format  |  1 +
 libcxx/docs/ReleaseNotes/18.rst   |  1 +
 libcxx/docs/Status/Cxx23Issues.csv|  2 +-
 libcxx/docs/Status/Cxx2cPapers.csv|  2 +-
 libcxx/docs/UsingLibcxx.rst   |  4 ++
 libcxx/include/__memory/allocator.h   |  8 +++-
 libcxx/include/memory |  2 +-
 ...cator_types.deprecated_in_cxx23.verify.cpp | 44 +++
 .../allocator_types.pass.cpp  |  2 +
 ...llocator_types.removed_in_cxx26.verify.cpp | 34 ++
 10 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx23.verify.cpp
 create mode 100644 
libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx26.verify.cpp

diff --git a/libcxx/.clang-format b/libcxx/.clang-format
index 56bdf2b5f911659..39ae1322ffa8a63 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -28,6 +28,7 @@ AttributeMacros: [
   '_LIBCPP_DEPRECATED_IN_CXX14',
   '_LIBCPP_DEPRECATED_IN_CXX17',
   '_LIBCPP_DEPRECATED_IN_CXX20',
+  '_LIBCPP_DEPRECATED_IN_CXX23',
   '_LIBCPP_DEPRECATED',
   '_LIBCPP_DISABLE_EXTENTSION_WARNING',
   '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION',
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 77b7939a0c0ac96..3e2fb8727941d6b 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2868R3 - Remove Deprecated ``std::allocator`` Typedef From C++26
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23Issues.csv 
b/libcxx/docs/Status/Cxx23Issues.csv
index b24ecc5525a1497..70480b338205804 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -15,7 +15,7 @@
 "`2743 `__","P0083R3 ``node_handle`` private 
members missing ""exposition only"" comment","November 2020","|Nothing To 
Do|",""
 "`2820 `__","Clarify  
macros","November 2020","|Nothing To Do|",""
 "`3120 `__","Unclear behavior of 
``monotonic_buffer_resource::release()``","November 2020","",""
-"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","",""
+"`3170 `__","``is_always_equal`` added to 
``std::allocator`` makes the standard library treat derived types as always 
equal","November 2020","|Complete|","18.0"
 "`3036 `__","``polymorphic_allocator::destroy`` is 
extraneous","November 2020","",""
 "`3171 `__","LWG2989 breaks ``directory_entry`` 
stream insertion","November 2020","|Complete|","14.0"
 "`3306 `__","``ranges::advance`` violates its 
preconditions","November 2020","|Complete|","14.0","|ranges|"
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c6..762cbc6d487c69d 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -36,7 +36,7 @@
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
 "`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
-"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
+"`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
 "`P2871R3 `__","LWG","Remove Deprecated Unicode 
Conversion Facets from C++26","Kona November 2023","|Complete|","18.0",""
 "`P2819R2 `__","LWG","Add tuple protocol to 

[libcxx] [flang] [libcxxabi] [clang-tools-extra] [libunwind] [lldb] [clang] [compiler-rt] [llvm] [libc] [libc++][span] P2447R4: `std::span` over an initializer list (PR #78157)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78157

>From 01f0ed005f2037fa4a4ec64ad5e1a114da1f5e99 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 10:42:55 +0200
Subject: [PATCH 01/10] [libc++][span] P2447R4: `std::span` over an initializer
 list

Implements: https://wg21.link/P2447R6
- https://eel.is/c++draft/span.syn
- https://eel.is/c++draft/span.overview
- https://eel.is/c++draft/span.cons
- https://eel.is/c++draft/diff
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/span   |  18 +++
 .../views/views.span/span.cons/array.pass.cpp |   4 +
 .../initializer_list.assert.pass.cpp  |  45 ++
 .../span.cons/initializer_list.pass.cpp   | 131 --
 .../span.cons/iterator_len.verify.cpp |  24 +++-
 .../generate_feature_test_macro_components.py |   1 -
 8 files changed, 204 insertions(+), 22 deletions(-)
 create mode 100644 
libcxx/test/std/containers/views/views.span/span.cons/initializer_list.assert.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 62a1fec627d0ca..bf0ef8d447a3a5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2447R6 - ``span`` over initializer list
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c..2a7ee46816e9d9 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -34,7 +34,7 @@
 "`P2918R2 `__","LWG","Runtime format strings 
II","Kona November 2023","|Complete|","18.0","|format|"
 "`P2909R4 `__","LWG","Fix formatting of code units 
as integers (Dude, where’s my ``char``?)","Kona November 
2023","|Complete|","18.0","|format| |DR|"
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
-"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
+"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","|Complete","18.0",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
 "`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
diff --git a/libcxx/include/span b/libcxx/include/span
index 007a32597f965b..7ce0faa9457099 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -68,6 +68,7 @@ public:
 constexpr span(const array& arr) noexcept;
 template
   constexpr explicit(Extent != dynamic_extent) span(R&& r);
+constexpr explicit(extent != dynamic_extent) 
span(std::initializer_list il); // Since C++26
 constexpr span(const span& other) noexcept = default;
 template 
 constexpr explicit(Extent != dynamic_extent) span(const 
span& s) noexcept;
@@ -228,6 +229,15 @@ public:
 requires(_Sz == 0)
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr explicit 
span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()} {
+// static_assert(false, "constructor (static extent) called");
+_LIBCPP_ASSERT_INTERNAL(_Extent == __il.size(), "Size mismatch in span's 
constructor _Extent != __il.size().");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
@@ -397,6 +407,14 @@ public:
   // [span.cons], span constructors, copy, assignment, and destructor
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr}, 
__size_{0} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()}, __size_{__il.size()} {
+// static_assert(false, "constructor (dynamic extent) called");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
diff --git 
a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp 
b/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
index 8fa7692c3b6370..b01fdda84789ce 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
+++ 

[libcxx] [flang] [libcxxabi] [clang-tools-extra] [libunwind] [lldb] [clang] [compiler-rt] [llvm] [libc] [libc++][span] P2447R4: `std::span` over an initializer list (PR #78157)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78157

>From 01f0ed005f2037fa4a4ec64ad5e1a114da1f5e99 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 10:42:55 +0200
Subject: [PATCH 1/9] [libc++][span] P2447R4: `std::span` over an initializer
 list

Implements: https://wg21.link/P2447R6
- https://eel.is/c++draft/span.syn
- https://eel.is/c++draft/span.overview
- https://eel.is/c++draft/span.cons
- https://eel.is/c++draft/diff
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/span   |  18 +++
 .../views/views.span/span.cons/array.pass.cpp |   4 +
 .../initializer_list.assert.pass.cpp  |  45 ++
 .../span.cons/initializer_list.pass.cpp   | 131 --
 .../span.cons/iterator_len.verify.cpp |  24 +++-
 .../generate_feature_test_macro_components.py |   1 -
 8 files changed, 204 insertions(+), 22 deletions(-)
 create mode 100644 
libcxx/test/std/containers/views/views.span/span.cons/initializer_list.assert.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 62a1fec627d0ca..bf0ef8d447a3a5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2447R6 - ``span`` over initializer list
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c..2a7ee46816e9d9 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -34,7 +34,7 @@
 "`P2918R2 `__","LWG","Runtime format strings 
II","Kona November 2023","|Complete|","18.0","|format|"
 "`P2909R4 `__","LWG","Fix formatting of code units 
as integers (Dude, where’s my ``char``?)","Kona November 
2023","|Complete|","18.0","|format| |DR|"
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
-"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
+"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","|Complete","18.0",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
 "`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
diff --git a/libcxx/include/span b/libcxx/include/span
index 007a32597f965b..7ce0faa9457099 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -68,6 +68,7 @@ public:
 constexpr span(const array& arr) noexcept;
 template
   constexpr explicit(Extent != dynamic_extent) span(R&& r);
+constexpr explicit(extent != dynamic_extent) 
span(std::initializer_list il); // Since C++26
 constexpr span(const span& other) noexcept = default;
 template 
 constexpr explicit(Extent != dynamic_extent) span(const 
span& s) noexcept;
@@ -228,6 +229,15 @@ public:
 requires(_Sz == 0)
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr explicit 
span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()} {
+// static_assert(false, "constructor (static extent) called");
+_LIBCPP_ASSERT_INTERNAL(_Extent == __il.size(), "Size mismatch in span's 
constructor _Extent != __il.size().");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
@@ -397,6 +407,14 @@ public:
   // [span.cons], span constructors, copy, assignment, and destructor
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr}, 
__size_{0} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()}, __size_{__il.size()} {
+// static_assert(false, "constructor (dynamic extent) called");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
diff --git 
a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp 
b/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
index 8fa7692c3b6370..b01fdda84789ce 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
+++ 

[clang] [llvm] [libc] [mlir] [polly] [libcxx] [compiler-rt] [lldb] [flang] [clang-tools-extra] [libunwind] [libcxxabi] [libc++][any] LWG3305: `any_cast` (PR #78215)

2024-01-18 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78215

>From 328c55879848d98a9bc068436d959b409b239bcc Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 09:46:26 +0200
Subject: [PATCH 1/2] [libc++][any] LWG3305: `any_cast`

Implements: https://wg21.link/LWG3305
- https://eel.is/c++draft/any.nonmembers
---
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/any|  7 
 .../any.nonmembers/any.cast/void.verify.cpp   | 34 +++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 
libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp

diff --git a/libcxx/docs/Status/Cxx2cIssues.csv 
b/libcxx/docs/Status/Cxx2cIssues.csv
index fe0f13f6e8cb2c..29f25b63ccb863 100644
--- a/libcxx/docs/Status/Cxx2cIssues.csv
+++ b/libcxx/docs/Status/Cxx2cIssues.csv
@@ -19,7 +19,7 @@
 "","","","","",""
 "`2392 `__","""character type"" is used but not 
defined","Kona November 2023","","",""
 "`3203 `__","``span`` element access 
invalidation","Kona November 2023","","",""
-"`3305 `__","``any_cast``","Kona November 
2023","","",""
+"`3305 `__","``any_cast``","Kona November 
2023","|Complete|","18.0",""
 "`3431 `__","``<=>`` for containers should require 
``three_way_comparable`` instead of ``<=>``","Kona November 2023","","",""
 "`3749 `__","``common_iterator`` should handle 
integer-class difference types","Kona November 2023","","",""
 "`3809 `__","Is 
``std::subtract_with_carry_engine`` supposed to work","Kona November 
2023","","",""
diff --git a/libcxx/include/any b/libcxx/include/any
index b9e0a8d94550cc..a157d763c63121 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -98,6 +98,7 @@ namespace std {
 #include <__type_traits/is_nothrow_move_constructible.h>
 #include <__type_traits/is_reference.h>
 #include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_cvref.h>
 #include <__type_traits/remove_reference.h>
@@ -555,6 +556,9 @@ inline _LIBCPP_HIDE_FROM_ABI 
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
 
 template 
 inline _LIBCPP_HIDE_FROM_ABI add_pointer_t> 
any_cast(any const* __any) _NOEXCEPT {
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   return std::any_cast<_ValueType>(const_cast(__any));
 }
@@ -572,6 +576,9 @@ inline _LIBCPP_HIDE_FROM_ABI _RetType 
__pointer_or_func_cast(void*, /*IsFunction
 template 
 _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT 
{
   using __any_imp::_Action;
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   typedef add_pointer_t<_ValueType> _ReturnType;
   if (__any && __any->__h_) {
diff --git 
a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp 
b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
new file mode 100644
index 00..c0733e544dcb24
--- /dev/null
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
@@ -0,0 +1,34 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+
+// 
+
+// template
+// const T* any_cast(const any* operand) noexcept;
+
+// template
+// T* any_cast(any* operand) noexcept;
+
+#include 
+
+void test() {
+  {
+const std::any ca = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+  {
+std::any a = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+}

>From 80fc2ca1ce009aa892f148b319129356e2c818c4 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Wed, 17 Jan 2024 18:16:04 +0200
Subject: [PATCH 2/2] Addressed comments

---
 libcxx/include/any| 4 
 .../std/utilities/any/any.nonmembers/any.cast/void.verify.cpp | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/libcxx/include/any b/libcxx/include/any
index a157d763c63121..378dfb6e21b536 100644
--- a/libcxx/include/any
+++ 

[clang] [libunwind] [llvm] [mlir] [lldb] [libc] [flang] [polly] [libcxx] [compiler-rt] [clang-tools-extra] [libcxxabi] [libc++][any] LWG3305: `any_cast` (PR #78215)

2024-01-17 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78215

>From 328c55879848d98a9bc068436d959b409b239bcc Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 09:46:26 +0200
Subject: [PATCH 1/2] [libc++][any] LWG3305: `any_cast`

Implements: https://wg21.link/LWG3305
- https://eel.is/c++draft/any.nonmembers
---
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/any|  7 
 .../any.nonmembers/any.cast/void.verify.cpp   | 34 +++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 
libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp

diff --git a/libcxx/docs/Status/Cxx2cIssues.csv 
b/libcxx/docs/Status/Cxx2cIssues.csv
index fe0f13f6e8cb2c2..29f25b63ccb863f 100644
--- a/libcxx/docs/Status/Cxx2cIssues.csv
+++ b/libcxx/docs/Status/Cxx2cIssues.csv
@@ -19,7 +19,7 @@
 "","","","","",""
 "`2392 `__","""character type"" is used but not 
defined","Kona November 2023","","",""
 "`3203 `__","``span`` element access 
invalidation","Kona November 2023","","",""
-"`3305 `__","``any_cast``","Kona November 
2023","","",""
+"`3305 `__","``any_cast``","Kona November 
2023","|Complete|","18.0",""
 "`3431 `__","``<=>`` for containers should require 
``three_way_comparable`` instead of ``<=>``","Kona November 2023","","",""
 "`3749 `__","``common_iterator`` should handle 
integer-class difference types","Kona November 2023","","",""
 "`3809 `__","Is 
``std::subtract_with_carry_engine`` supposed to work","Kona November 
2023","","",""
diff --git a/libcxx/include/any b/libcxx/include/any
index b9e0a8d94550ccd..a157d763c63121c 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -98,6 +98,7 @@ namespace std {
 #include <__type_traits/is_nothrow_move_constructible.h>
 #include <__type_traits/is_reference.h>
 #include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_cvref.h>
 #include <__type_traits/remove_reference.h>
@@ -555,6 +556,9 @@ inline _LIBCPP_HIDE_FROM_ABI 
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
 
 template 
 inline _LIBCPP_HIDE_FROM_ABI add_pointer_t> 
any_cast(any const* __any) _NOEXCEPT {
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   return std::any_cast<_ValueType>(const_cast(__any));
 }
@@ -572,6 +576,9 @@ inline _LIBCPP_HIDE_FROM_ABI _RetType 
__pointer_or_func_cast(void*, /*IsFunction
 template 
 _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT 
{
   using __any_imp::_Action;
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   typedef add_pointer_t<_ValueType> _ReturnType;
   if (__any && __any->__h_) {
diff --git 
a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp 
b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
new file mode 100644
index 000..c0733e544dcb24c
--- /dev/null
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
@@ -0,0 +1,34 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+
+// 
+
+// template
+// const T* any_cast(const any* operand) noexcept;
+
+// template
+// T* any_cast(any* operand) noexcept;
+
+#include 
+
+void test() {
+  {
+const std::any ca = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+  {
+std::any a = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+}

>From 80fc2ca1ce009aa892f148b319129356e2c818c4 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Wed, 17 Jan 2024 18:16:04 +0200
Subject: [PATCH 2/2] Addressed comments

---
 libcxx/include/any| 4 
 .../std/utilities/any/any.nonmembers/any.cast/void.verify.cpp | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/libcxx/include/any b/libcxx/include/any
index a157d763c63121c..378dfb6e21b5360 100644
--- a/libcxx/include/any

[compiler-rt] [libunwind] [libcxx] [clang] [flang] [libc] [lldb] [libcxxabi] [clang-tools-extra] [llvm] [libc++][any] LWG3305: `any_cast` (PR #78215)

2024-01-17 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78215

>From 328c55879848d98a9bc068436d959b409b239bcc Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 09:46:26 +0200
Subject: [PATCH] [libc++][any] LWG3305: `any_cast`

Implements: https://wg21.link/LWG3305
- https://eel.is/c++draft/any.nonmembers
---
 libcxx/docs/Status/Cxx2cIssues.csv|  2 +-
 libcxx/include/any|  7 
 .../any.nonmembers/any.cast/void.verify.cpp   | 34 +++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 
libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp

diff --git a/libcxx/docs/Status/Cxx2cIssues.csv 
b/libcxx/docs/Status/Cxx2cIssues.csv
index fe0f13f6e8cb2c..29f25b63ccb863 100644
--- a/libcxx/docs/Status/Cxx2cIssues.csv
+++ b/libcxx/docs/Status/Cxx2cIssues.csv
@@ -19,7 +19,7 @@
 "","","","","",""
 "`2392 `__","""character type"" is used but not 
defined","Kona November 2023","","",""
 "`3203 `__","``span`` element access 
invalidation","Kona November 2023","","",""
-"`3305 `__","``any_cast``","Kona November 
2023","","",""
+"`3305 `__","``any_cast``","Kona November 
2023","|Complete|","18.0",""
 "`3431 `__","``<=>`` for containers should require 
``three_way_comparable`` instead of ``<=>``","Kona November 2023","","",""
 "`3749 `__","``common_iterator`` should handle 
integer-class difference types","Kona November 2023","","",""
 "`3809 `__","Is 
``std::subtract_with_carry_engine`` supposed to work","Kona November 
2023","","",""
diff --git a/libcxx/include/any b/libcxx/include/any
index b9e0a8d94550cc..a157d763c63121 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -98,6 +98,7 @@ namespace std {
 #include <__type_traits/is_nothrow_move_constructible.h>
 #include <__type_traits/is_reference.h>
 #include <__type_traits/is_same.h>
+#include <__type_traits/is_void.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_cvref.h>
 #include <__type_traits/remove_reference.h>
@@ -555,6 +556,9 @@ inline _LIBCPP_HIDE_FROM_ABI 
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _ValueType
 
 template 
 inline _LIBCPP_HIDE_FROM_ABI add_pointer_t> 
any_cast(any const* __any) _NOEXCEPT {
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   return std::any_cast<_ValueType>(const_cast(__any));
 }
@@ -572,6 +576,9 @@ inline _LIBCPP_HIDE_FROM_ABI _RetType 
__pointer_or_func_cast(void*, /*IsFunction
 template 
 _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT 
{
   using __any_imp::_Action;
+#  if _LIBCPP_STD_VER >= 26
+  static_assert(!is_void_v<_ValueType>, "_ValueType may not be void.");
+#  endif
   static_assert(!is_reference<_ValueType>::value, "_ValueType may not be a 
reference.");
   typedef add_pointer_t<_ValueType> _ReturnType;
   if (__any && __any->__h_) {
diff --git 
a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp 
b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
new file mode 100644
index 00..c0733e544dcb24
--- /dev/null
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/void.verify.cpp
@@ -0,0 +1,34 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+
+// 
+
+// template
+// const T* any_cast(const any* operand) noexcept;
+
+// template
+// T* any_cast(any* operand) noexcept;
+
+#include 
+
+void test() {
+  {
+const std::any ca = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+  {
+std::any a = 1;
+
+// expected-error-re@any:* {{static assertion failed{{.*}}_ValueType may 
not be void.}}
+std::any_cast(); // expected-note {{requested here}}
+  }
+}

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[compiler-rt] [libunwind] [libcxx] [clang] [flang] [libc] [lldb] [libcxxabi] [clang-tools-extra] [llvm] [libc++][span] P2447R4: `std::span` over an initializer list (PR #78157)

2024-01-17 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78157

>From 01f0ed005f2037fa4a4ec64ad5e1a114da1f5e99 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Thu, 11 Jan 2024 10:42:55 +0200
Subject: [PATCH 1/9] [libc++][span] P2447R4: `std::span` over an initializer
 list

Implements: https://wg21.link/P2447R6
- https://eel.is/c++draft/span.syn
- https://eel.is/c++draft/span.overview
- https://eel.is/c++draft/span.cons
- https://eel.is/c++draft/diff
---
 libcxx/docs/ReleaseNotes/18.rst   |   1 +
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/span   |  18 +++
 .../views/views.span/span.cons/array.pass.cpp |   4 +
 .../initializer_list.assert.pass.cpp  |  45 ++
 .../span.cons/initializer_list.pass.cpp   | 131 --
 .../span.cons/iterator_len.verify.cpp |  24 +++-
 .../generate_feature_test_macro_components.py |   1 -
 8 files changed, 204 insertions(+), 22 deletions(-)
 create mode 100644 
libcxx/test/std/containers/views/views.span/span.cons/initializer_list.assert.pass.cpp

diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 62a1fec627d0ca..bf0ef8d447a3a5 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -60,6 +60,7 @@ Implemented Papers
 - P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P2447R6 - ``span`` over initializer list
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 
b/libcxx/docs/Status/Cxx2cPapers.csv
index 5701717f39766c..2a7ee46816e9d9 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -34,7 +34,7 @@
 "`P2918R2 `__","LWG","Runtime format strings 
II","Kona November 2023","|Complete|","18.0","|format|"
 "`P2909R4 `__","LWG","Fix formatting of code units 
as integers (Dude, where’s my ``char``?)","Kona November 
2023","|Complete|","18.0","|format| |DR|"
 "`P0952R2 `__","LWG","A new specification for 
``std::generate_canonical``","Kona November 2023","","",""
-"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","","",""
+"`P2447R6 `__","LWG","``std::span`` over an 
initializer list","Kona November 2023","|Complete","18.0",""
 "`P2821R5 `__","LWG","``span.at()``","Kona November 
2023","|Complete|","18.0",""
 "`P2868R3 `__","LWG","Remove Deprecated 
``std::allocator`` Typedef From C++26","Kona November 2023","","",""
 "`P2870R3 `__","LWG","Remove 
``basic_string::reserve()`` From C++26","Kona November 
2023","|Complete|","18.0",""
diff --git a/libcxx/include/span b/libcxx/include/span
index 007a32597f965b..7ce0faa9457099 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -68,6 +68,7 @@ public:
 constexpr span(const array& arr) noexcept;
 template
   constexpr explicit(Extent != dynamic_extent) span(R&& r);
+constexpr explicit(extent != dynamic_extent) 
span(std::initializer_list il); // Since C++26
 constexpr span(const span& other) noexcept = default;
 template 
 constexpr explicit(Extent != dynamic_extent) span(const 
span& s) noexcept;
@@ -228,6 +229,15 @@ public:
 requires(_Sz == 0)
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr explicit 
span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()} {
+// static_assert(false, "constructor (static extent) called");
+_LIBCPP_ASSERT_INTERNAL(_Extent == __il.size(), "Size mismatch in span's 
constructor _Extent != __il.size().");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
@@ -397,6 +407,14 @@ public:
   // [span.cons], span constructors, copy, assignment, and destructor
   _LIBCPP_HIDE_FROM_ABI constexpr span() noexcept : __data_{nullptr}, 
__size_{0} {}
 
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr span(std::initializer_list __il)
+requires is_const_v
+  : __data_{__il.begin()}, __size_{__il.size()} {
+// static_assert(false, "constructor (dynamic extent) called");
+  }
+#  endif
+
   constexpr span(const span&) noexcept= default;
   constexpr span& operator=(const span&) noexcept = default;
 
diff --git 
a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp 
b/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
index 8fa7692c3b6370..b01fdda84789ce 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
+++ 

[flang] [libc] [mlir] [clang-tools-extra] [lld] [openmp] [llvm] [libcxx] [clang] [compiler-rt] [lldb] [libc++][memory] P1132R8: `out_ptr` - a scalable output pointer abstraction (PR #73618)

2024-01-17 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,102 @@
+// -*- C++ -*-
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___INOUT_PTR_H
+#define _LIBCPP___INOUT_PTR_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/is_specialization.h>
+#include <__type_traits/is_void.h>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template 
+class _LIBCPP_TEMPLATE_VIS inout_ptr_t {
+  static_assert(!__is_specialization_v<_Smart, shared_ptr>, "std::shared_ptr<> 
is not supported");
+
+public:
+  _LIBCPP_HIDE_FROM_ABI explicit inout_ptr_t(_Smart& __s, _Args... __args)
+  : __s_(__s), __a_(std::forward<_Args>(__args)...), __p_([&__s] {
+  if constexpr (is_pointer_v<_Smart>) {
+return __s;
+  } else {
+return __s.get();
+  }
+}()) {
+if constexpr (requires { __s.release(); }) {
+  __s.release();
+} else {
+  __s = _Smart();
+}
+  }
+
+  _LIBCPP_HIDE_FROM_ABI inout_ptr_t(const inout_ptr_t&) = delete;
+
+  _LIBCPP_HIDE_FROM_ABI ~inout_ptr_t() {
+if constexpr (!is_pointer_v<_Smart>) {
+  if (!__p_) {
+return;
+  }
+}
+
+using _SP = __pointer_of_or_t<_Smart, _Pointer>;
+if constexpr (is_pointer_v<_Smart>) {
+  std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SP>(__p_), 
std::forward<_Args>(__args)...); },
+ std::move(__a_));
+} else if constexpr (__resettable_smart_pointer_with_args<_Smart, 
_Pointer, _Args...>) {
+  std::apply([&](auto&&... __args) { __s_.reset(static_cast<_SP>(__p_), 
std::forward<_Args>(__args)...); },
+ std::move(__a_));
+} else if constexpr (is_constructible_v<_Smart, _SP, _Args...>) {
+  std::apply([&](auto&&... __args) { __s_ = _Smart(static_cast<_SP>(__p_), 
std::forward<_Args>(__args)...); },
+ std::move(__a_));
+} else {
+  static_assert(is_pointer_v<_Smart> || 
__resettable_smart_pointer_with_args<_Smart, _Pointer, _Args...> ||
+is_constructible_v<_Smart, _SP, _Args...>);
+}
+  }
+
+  _LIBCPP_HIDE_FROM_ABI operator _Pointer*() const noexcept { return 
std::addressof(const_cast<_Pointer&>(__p_)); }
+
+  _LIBCPP_HIDE_FROM_ABI operator void**() const noexcept
+requires(!is_same_v<_Pointer, void*>)
+  {
+static_assert(is_pointer_v<_Pointer>);
+
+return reinterpret_cast(static_cast<_Pointer*>(*this));
+  }
+
+private:
+  _Smart& __s_;
+  tuple<_Args...> __a_;
+  _Pointer __p_;
+};
+
+template 
+_LIBCPP_HIDE_FROM_ABI auto inout_ptr(_Smart& __s, _Args&&... __args) {
+  using _Ptr = conditional_t, __pointer_of_t<_Smart>, 
_Pointer>;
+  return std::inout_ptr_t<_Smart, _Ptr, _Args&&...>(__s, 
std::forward<_Args>(__args)...);

H-G-Hristov wrote:

Maybe I don't understand but the following fails to compile: 
https://godbolt.org/z/cseMEfdj5

> opt/compiler-explorer/gcc-trunk-20240117/include/c++/14.0.1/bits/out_ptr.h:212:42:
>  error: use of deleted function 'constexpr Foo& Foo::operator=(const Foo&)'
  212 |   _M_smart._M_t._M_deleter() = std::forward<_Del2>(_M_del);
  |   ~~~^

```c++
#include 
#include 

struct Foo {
Foo() = default;
Foo(Foo const&) = delete;  // not copyable
Foo(Foo&&) = delete;   // not movable either!

void operator()(int*) {};
};

int main() {
std::unique_ptr smart;
Foo arg;
// std::ignore = std::out_ptr(smart, arg);
std::ignore = std::inout_ptr(smart, arg);
}
```

https://github.com/llvm/llvm-project/pull/73618
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lldb] [mlir] [libc] [clang] [lld] [openmp] [clang-tools-extra] [compiler-rt] [flang] [llvm] [libcxx] [libc++][memory] P1132R8: `out_ptr` - a scalable output pointer abstraction (PR #73618)

2024-01-17 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/73618
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxxabi] [flang] [llvm] [libc] [libunwind] [clang-tools-extra] [lld] [clang] [lldb] [compiler-rt] [mlir] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-17 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

How do I fix the following generated files check error:

```diff
[8/9] cd 
/home/runner/work/llvm-project/llvm-project/build/check-generated-output/libcxx/utils
 && /usr/bin/python3.10 
/home/runner/work/llvm-project/llvm-project/libcxx/utils/generate_iwyu_mapping.py
[9/9] cd 
/home/runner/work/llvm-project/llvm-project/build/check-generated-output/libcxx/utils
 && /usr/bin/python3.10 
/home/runner/work/llvm-project/llvm-project/libcxx/utils/generate_escaped_output_table.py
 
/home/runner/work/llvm-project/llvm-project/libcxx/include/__format/escaped_output_table.h
diff --git a/libcxx/include/libcxx.imp b/libcxx/include/libcxx.imp
index 8616f9639..45fa4a954 100644
--- a/libcxx/include/libcxx.imp
+++ b/libcxx/include/libcxx.imp
@@ -559,6 +559,7 @@
   { include: [ "<__numeric/pstl_reduce.h>", "private", "", "public" ] 
},
   { include: [ "<__numeric/pstl_transform_reduce.h>", "private", "", 
"public" ] },
   { include: [ "<__numeric/reduce.h>", "private", "", "public" ] },
+  { include: [ "<__numeric/saturation_arithmetic.h>", "private", "", 
"public" ] },
   { include: [ "<__numeric/transform_exclusive_scan.h>", "private", 
"", "public" ] },
   { include: [ "<__numeric/transform_inclusive_scan.h>", "private", 
"", "public" ] },
   { include: [ "<__numeric/transform_reduce.h>", "private", "", 
"public" ] },
```

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [clang] [lldb] [llvm] [lld] [libunwind] [libcxxabi] [clang-tools-extra] [libc] [compiler-rt] [mlir] [libcxx] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-17 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,119 @@
+// -*- C++ -*-
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+#define _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__type_traits/decay.h>
+#include <__utility/cmp.h>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+template 
+concept __libcpp_standard_integer = __libcpp_unsigned_integer> || 
__libcpp_signed_integer>;
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
+  if (_Tp __sum; !__builtin_add_overflow(__x, __y, &__sum))
+return __sum;
+  // Handle overflow
+  if constexpr (__libcpp_unsigned_integer<_Tp>) {
+return std::numeric_limits<_Tp>::max();
+  } else {
+// Signed addition overflow
+if (__x > 0)
+  // Overflows if (x > 0 && y > 0)
+  return std::numeric_limits<_Tp>::max();
+else
+  // Overflows if  (x < 0 && y < 0)
+  return std::numeric_limits<_Tp>::min();
+  }
+}
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {
+  if (_Tp __sub; !__builtin_sub_overflow(__x, __y, &__sub))
+return __sub;
+  // Handle overflow
+  if constexpr (__libcpp_unsigned_integer<_Tp>) {
+// Overflows if (x < y)
+return std::numeric_limits<_Tp>::min();
+  } else {
+// Signed subtration overflow
+if (__x > 0)
+  // Overflows if (x > 0 && y < 0)
+  return std::numeric_limits<_Tp>::max();
+else
+  // Overflows if (x < 0 && y > 0)
+  return std::numeric_limits<_Tp>::min();
+  }
+}
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {
+  if (_Tp __mul; !__builtin_mul_overflow(__x, __y, &__mul))
+return __mul;
+  // Handle overflow
+  if constexpr (__libcpp_unsigned_integer<_Tp>) {
+return std::numeric_limits<_Tp>::max();
+  } else {
+// Signed multiplication overflow
+if (__x > 0) {
+  if (__y > 0)
+// Overflows if (x > 0 && y > 0)
+return std::numeric_limits<_Tp>::max();
+  // Overflows if (x > 0 && y < 0)
+  return std::numeric_limits<_Tp>::min();
+}
+if (__y > 0)
+  // Overflows if (x < 0 && y > 0)
+  return std::numeric_limits<_Tp>::min();
+// Overflows if (x < 0 && y < 0)
+return std::numeric_limits<_Tp>::max();
+  }
+}
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {
+  _LIBCPP_ASSERT_UNCATEGORIZED(__y != 0, "Division by 0 is undefined");
+  if constexpr (__libcpp_unsigned_integer<_Tp>) {
+return __x / __y;
+  } else {
+// Handle signed division overflow
+if (__x == std::numeric_limits<_Tp>::min() && __y == _Tp{-1})
+  return std::numeric_limits<_Tp>::max();
+return __x / __y;
+  }
+}
+
+template <__libcpp_standard_integer _Rp, __libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {

H-G-Hristov wrote:

OK. I'll remove the optimization for now. On optimized builds the difference 
according to my quick, stupid benchmark is near zero and on unoptimized builds 
less than 10%.
https://quick-bench.com/q/QFdMFKaw_5OnmeDqB_BMkh0BaSg

Please comment if you disagree.

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[lld] [llvm] [compiler-rt] [libcxx] [libunwind] [flang] [clang] [mlir] [clang-tools-extra] [libc] [lldb] [libcxxabi] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-16 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,119 @@
+// -*- C++ -*-
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+#define _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__type_traits/decay.h>
+#include <__utility/cmp.h>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+template 
+concept __libcpp_standard_integer = __libcpp_unsigned_integer> || 
__libcpp_signed_integer>;
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
+  if (_Tp __sum; !__builtin_add_overflow(__x, __y, &__sum))

H-G-Hristov wrote:

> `__builtin_add_overflow` already works with 128-bit integers: 
> https://godbolt.org/z/non8eMTfj, as well as bit-precise integers: 
> https://godbolt.org/z/dxs7h4G5b so I'm not certain there are Clang changes 
> needed?

Yeah, I added 128-bit integers to the tests and it seems to work. Thank you!

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [mlir] [clang-tools-extra] [libcxx] [libc++][concepts] Implements concept helper `__libcpp_integer` (PR #78086)

2024-01-14 Thread Hristo Hristov via cfe-commits

https://github.com/Zingam closed https://github.com/llvm/llvm-project/pull/78086
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [mlir] [clang-tools-extra] [clang] [libcxx] [libc++][concepts] Implements concept helper `__libcpp_integer` (PR #78086)

2024-01-14 Thread Hristo Hristov via cfe-commits

H-G-Hristov wrote:

> LGTM! Thanks! Please ping me when you've update your other patch with these 
> changes.

Thank you! I'll ping you when I am ready with the other patch. I still need to 
implement additional tests.

https://github.com/llvm/llvm-project/pull/78086
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [libcxx] [mlir] [libc++][concepts] Implements concept helper `__libcpp_integer` (PR #78086)

2024-01-14 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/78086

>From f2008de694bc867efa9632df183f64e3ea194e4e Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Sun, 14 Jan 2024 09:34:46 +0200
Subject: [PATCH 1/5] [libc++][concepts] Implements  concept helper
 `__libcpp_integer`

...and tests.
---
 libcxx/include/__concepts/arithmetic.h|   4 +
 .../arithmetic.compile.pass.cpp   | 117 ++
 2 files changed, 121 insertions(+)
 create mode 100644 
libcxx/test/libcxx/concepts/concepts.arithmetic/arithmetic.compile.pass.cpp

diff --git a/libcxx/include/__concepts/arithmetic.h 
b/libcxx/include/__concepts/arithmetic.h
index f41e4c9f2747cc3..0c44f117805f368 100644
--- a/libcxx/include/__concepts/arithmetic.h
+++ b/libcxx/include/__concepts/arithmetic.h
@@ -42,9 +42,13 @@ concept floating_point = is_floating_point_v<_Tp>;
 
 template 
 concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
+
 template 
 concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
 
+template 
+concept __libcpp_integer = __libcpp_unsigned_integer<_Tp> || 
__libcpp_signed_integer<_Tp>;
+
 #endif // _LIBCPP_STD_VER >= 20
 
 _LIBCPP_END_NAMESPACE_STD
diff --git 
a/libcxx/test/libcxx/concepts/concepts.arithmetic/arithmetic.compile.pass.cpp 
b/libcxx/test/libcxx/concepts/concepts.arithmetic/arithmetic.compile.pass.cpp
new file mode 100644
index 000..aefe21d852df52b
--- /dev/null
+++ 
b/libcxx/test/libcxx/concepts/concepts.arithmetic/arithmetic.compile.pass.cpp
@@ -0,0 +1,117 @@
+//===--===//
+//
+// 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
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+#include 
+
+struct SomeObject {};
+
+// Concept helpers for the internal type traits for the fundamental types.
+
+// template 
+// concept __libcpp_unsigned_integer;
+
+// Unsigned
+static_assert(std::__libcpp_unsigned_integer);
+static_assert(std::__libcpp_unsigned_integer);
+static_assert(std::__libcpp_unsigned_integer);
+static_assert(std::__libcpp_unsigned_integer);
+static_assert(std::__libcpp_unsigned_integer);
+static_assert(std::__libcpp_unsigned_integer);
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(std::__libcpp_unsigned_integer<__uint128_t>);
+#endif
+// Signed
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(!std::__libcpp_unsigned_integer<__int128_t>);
+#endif
+// Non-integer
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+static_assert(!std::__libcpp_unsigned_integer);
+
+// template 
+// concept __libcpp_signed_integer;
+
+// Unsigned
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(!std::__libcpp_signed_integer<__uint128_t>);
+#endif
+// Signed
+static_assert(std::__libcpp_signed_integer);
+static_assert(std::__libcpp_signed_integer);
+static_assert(std::__libcpp_signed_integer);
+static_assert(std::__libcpp_signed_integer);
+static_assert(std::__libcpp_signed_integer);
+static_assert(std::__libcpp_signed_integer);
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(std::__libcpp_signed_integer<__int128_t>);
+#endif
+// Non-integer
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+static_assert(!std::__libcpp_signed_integer);
+
+// template 
+// concept __libcpp_integer;
+
+// Unsigned
+static_assert(std::__libcpp_integer);
+static_assert(std::__libcpp_integer);
+static_assert(std::__libcpp_integer);
+static_assert(std::__libcpp_integer);
+static_assert(std::__libcpp_integer);

[compiler-rt] [clang] [libcxx] [llvm] [clang-tools-extra] [mlir] [lldb] [flang] [lld] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-14 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/77967

>From 48c4463e8817c8ee0f00ffa7422e6fafbe838275 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Wed, 10 Jan 2024 13:46:19 +0200
Subject: [PATCH 01/13] [libc++][numeric] P0543R3: Saturation arithmetic

Implements: https://wg21.link/P0543R3
- https://eel.is/c++draft/numeric.sat

Additional notes:
- Division: https://eel.is/c++draft/expr.mul#4
- Arithmetic conversions: https://eel.is/c++draft/expr.arith.conv#1.5
- Clang builtins: 
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions
---
 libcxx/docs/FeatureTestMacroTable.rst |   2 +-
 libcxx/docs/ReleaseNotes/18.rst   |   7 +-
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 .../include/__numeric/saturation_arithmetic.h | 135 ++
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/numeric|  13 ++
 libcxx/include/version|   2 +-
 libcxx/modules/std/numeric.inc|  10 ++
 .../numeric.version.compile.pass.cpp  |  16 +--
 .../version.version.compile.pass.cpp  |  16 +--
 .../numeric.ops.sat/add_sat.pass.cpp  | 129 +
 .../numeric.ops.sat/add_sat.verify.cpp|  39 +
 .../numeric.ops.sat/div_sat.assert.pass.cpp   |  53 +++
 .../numeric.ops.sat/div_sat.pass.cpp  | 108 ++
 .../numeric.ops.sat/div_sat.verify.cpp|  39 +
 .../numeric.ops.sat/mul_sat.pass.cpp  | 119 +++
 .../numeric.ops.sat/mul_sat.verify.cpp|  39 +
 .../numeric.ops.sat/saturate_cast.pass.cpp| 132 +
 .../numeric.ops.sat/saturate_cast.verify.cpp  |  44 ++
 .../numeric.ops.sat/sub_sat.pass.cpp  | 107 ++
 .../numeric.ops.sat/sub_sat.verify.cpp|  39 +
 .../generate_feature_test_macro_components.py |   5 +-
 23 files changed, 1026 insertions(+), 32 deletions(-)
 create mode 100644 libcxx/include/__numeric/saturation_arithmetic.h
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.assert.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.verify.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index 893a3b13ca06e0..9dd9c0c023bc8a 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -432,7 +432,7 @@ Status
 --- -
 ``__cpp_lib_rcu``   *unimplemented*
 --- -
-``__cpp_lib_saturation_arithmetic`` *unimplemented*
+``__cpp_lib_saturation_arithmetic`` ``202311L``
 --- -
 ``__cpp_lib_smart_ptr_owner_equality``  *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 6de7d07e454d34..877e387d9280fd 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -54,12 +54,13 @@ Implemented Papers
 - P2905R2 - Runtime format strings
 - P2918R2 - Runtime format strings II
 - P2871R3 - Remove Deprecated Unicode Conversion Facets from C++26
-- P2870R3 - Remove basic_string::reserve()
+- P2870R3 - Remove ``basic_string::reserve()``
 - P2909R4 - Fix formatting of code units as integers (Dude, where’s my 
``char``?)
-- P2821R5 - span.at()
-- P0521R0 - Proposed Resolution for CA 14 (shared_ptr use_count/unique)
+- P2821R5 - ``span.at()``
+- P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P0543R3 - Saturation arithmetic
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 

[compiler-rt] [clang] [libcxx] [llvm] [clang-tools-extra] [mlir] [lldb] [flang] [lld] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-14 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/77967

>From 48c4463e8817c8ee0f00ffa7422e6fafbe838275 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Wed, 10 Jan 2024 13:46:19 +0200
Subject: [PATCH 01/13] [libc++][numeric] P0543R3: Saturation arithmetic

Implements: https://wg21.link/P0543R3
- https://eel.is/c++draft/numeric.sat

Additional notes:
- Division: https://eel.is/c++draft/expr.mul#4
- Arithmetic conversions: https://eel.is/c++draft/expr.arith.conv#1.5
- Clang builtins: 
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions
---
 libcxx/docs/FeatureTestMacroTable.rst |   2 +-
 libcxx/docs/ReleaseNotes/18.rst   |   7 +-
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 .../include/__numeric/saturation_arithmetic.h | 135 ++
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/numeric|  13 ++
 libcxx/include/version|   2 +-
 libcxx/modules/std/numeric.inc|  10 ++
 .../numeric.version.compile.pass.cpp  |  16 +--
 .../version.version.compile.pass.cpp  |  16 +--
 .../numeric.ops.sat/add_sat.pass.cpp  | 129 +
 .../numeric.ops.sat/add_sat.verify.cpp|  39 +
 .../numeric.ops.sat/div_sat.assert.pass.cpp   |  53 +++
 .../numeric.ops.sat/div_sat.pass.cpp  | 108 ++
 .../numeric.ops.sat/div_sat.verify.cpp|  39 +
 .../numeric.ops.sat/mul_sat.pass.cpp  | 119 +++
 .../numeric.ops.sat/mul_sat.verify.cpp|  39 +
 .../numeric.ops.sat/saturate_cast.pass.cpp| 132 +
 .../numeric.ops.sat/saturate_cast.verify.cpp  |  44 ++
 .../numeric.ops.sat/sub_sat.pass.cpp  | 107 ++
 .../numeric.ops.sat/sub_sat.verify.cpp|  39 +
 .../generate_feature_test_macro_components.py |   5 +-
 23 files changed, 1026 insertions(+), 32 deletions(-)
 create mode 100644 libcxx/include/__numeric/saturation_arithmetic.h
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.assert.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.verify.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index 893a3b13ca06e0..9dd9c0c023bc8a 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -432,7 +432,7 @@ Status
 --- -
 ``__cpp_lib_rcu``   *unimplemented*
 --- -
-``__cpp_lib_saturation_arithmetic`` *unimplemented*
+``__cpp_lib_saturation_arithmetic`` ``202311L``
 --- -
 ``__cpp_lib_smart_ptr_owner_equality``  *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 6de7d07e454d34..877e387d9280fd 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -54,12 +54,13 @@ Implemented Papers
 - P2905R2 - Runtime format strings
 - P2918R2 - Runtime format strings II
 - P2871R3 - Remove Deprecated Unicode Conversion Facets from C++26
-- P2870R3 - Remove basic_string::reserve()
+- P2870R3 - Remove ``basic_string::reserve()``
 - P2909R4 - Fix formatting of code units as integers (Dude, where’s my 
``char``?)
-- P2821R5 - span.at()
-- P0521R0 - Proposed Resolution for CA 14 (shared_ptr use_count/unique)
+- P2821R5 - ``span.at()``
+- P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P0543R3 - Saturation arithmetic
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 

[compiler-rt] [clang] [libcxx] [llvm] [clang-tools-extra] [mlir] [lldb] [flang] [lld] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-14 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov updated 
https://github.com/llvm/llvm-project/pull/77967

>From 48c4463e8817c8ee0f00ffa7422e6fafbe838275 Mon Sep 17 00:00:00 2001
From: Zingam 
Date: Wed, 10 Jan 2024 13:46:19 +0200
Subject: [PATCH 01/12] [libc++][numeric] P0543R3: Saturation arithmetic

Implements: https://wg21.link/P0543R3
- https://eel.is/c++draft/numeric.sat

Additional notes:
- Division: https://eel.is/c++draft/expr.mul#4
- Arithmetic conversions: https://eel.is/c++draft/expr.arith.conv#1.5
- Clang builtins: 
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions
---
 libcxx/docs/FeatureTestMacroTable.rst |   2 +-
 libcxx/docs/ReleaseNotes/18.rst   |   7 +-
 libcxx/docs/Status/Cxx2cPapers.csv|   2 +-
 libcxx/include/CMakeLists.txt |   1 +
 .../include/__numeric/saturation_arithmetic.h | 135 ++
 libcxx/include/module.modulemap.in|   1 +
 libcxx/include/numeric|  13 ++
 libcxx/include/version|   2 +-
 libcxx/modules/std/numeric.inc|  10 ++
 .../numeric.version.compile.pass.cpp  |  16 +--
 .../version.version.compile.pass.cpp  |  16 +--
 .../numeric.ops.sat/add_sat.pass.cpp  | 129 +
 .../numeric.ops.sat/add_sat.verify.cpp|  39 +
 .../numeric.ops.sat/div_sat.assert.pass.cpp   |  53 +++
 .../numeric.ops.sat/div_sat.pass.cpp  | 108 ++
 .../numeric.ops.sat/div_sat.verify.cpp|  39 +
 .../numeric.ops.sat/mul_sat.pass.cpp  | 119 +++
 .../numeric.ops.sat/mul_sat.verify.cpp|  39 +
 .../numeric.ops.sat/saturate_cast.pass.cpp| 132 +
 .../numeric.ops.sat/saturate_cast.verify.cpp  |  44 ++
 .../numeric.ops.sat/sub_sat.pass.cpp  | 107 ++
 .../numeric.ops.sat/sub_sat.verify.cpp|  39 +
 .../generate_feature_test_macro_components.py |   5 +-
 23 files changed, 1026 insertions(+), 32 deletions(-)
 create mode 100644 libcxx/include/__numeric/saturation_arithmetic.h
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.assert.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.verify.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp
 create mode 100644 
libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.verify.cpp

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index 893a3b13ca06e0..9dd9c0c023bc8a 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -432,7 +432,7 @@ Status
 --- -
 ``__cpp_lib_rcu``   *unimplemented*
 --- -
-``__cpp_lib_saturation_arithmetic`` *unimplemented*
+``__cpp_lib_saturation_arithmetic`` ``202311L``
 --- -
 ``__cpp_lib_smart_ptr_owner_equality``  *unimplemented*
 --- -
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 6de7d07e454d34..877e387d9280fd 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -54,12 +54,13 @@ Implemented Papers
 - P2905R2 - Runtime format strings
 - P2918R2 - Runtime format strings II
 - P2871R3 - Remove Deprecated Unicode Conversion Facets from C++26
-- P2870R3 - Remove basic_string::reserve()
+- P2870R3 - Remove ``basic_string::reserve()``
 - P2909R4 - Fix formatting of code units as integers (Dude, where’s my 
``char``?)
-- P2821R5 - span.at()
-- P0521R0 - Proposed Resolution for CA 14 (shared_ptr use_count/unique)
+- P2821R5 - ``span.at()``
+- P0521R0 - Proposed Resolution for CA 14 (``shared_ptr`` ``use_count/unique``)
 - P1759R6 - Native handles and file streams
 - P2517R1 - Add a conditional ``noexcept`` specification to ``std::apply``
+- P0543R3 - Saturation arithmetic
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv 

[mlir] [clang] [compiler-rt] [libcxx] [clang-tools-extra] [flang] [llvm] [lld] [lldb] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-13 Thread Hristo Hristov via cfe-commits


@@ -0,0 +1,119 @@
+// -*- C++ -*-
+//===--===//
+//
+// 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
+//
+//===--===//
+
+#ifndef _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+#define _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
+
+#include <__concepts/arithmetic.h>
+#include <__config>
+#include <__type_traits/decay.h>
+#include <__utility/cmp.h>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+template 
+concept __libcpp_standard_integer = __libcpp_unsigned_integer> || 
__libcpp_signed_integer>;
+
+template <__libcpp_standard_integer _Tp>
+_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
+  if (_Tp __sum; !__builtin_add_overflow(__x, __y, &__sum))

H-G-Hristov wrote:

> These builtins don't work with 128-bit integrals. @AaronBallman are you happy 
> to receive patches for this in Clang? If so what is the proper name for 
> `__builtin_uaddXX_overflow` and `builtin_saddXX_overflow`? Obviously 
> there should be patches for `sub` and `mul`.
> 
> @H-G-Hristov if acceptable for Clang do you want to do the work?

Yes, I could try to do the work. Please note I have no experience with Clang 
yet.

https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lldb] [lld] [clang-tools-extra] [llvm] [compiler-rt] [libcxx] [mlir] [flang] [libc++][numeric] P0543R3: Saturation arithmetic (PR #77967)

2024-01-13 Thread Hristo Hristov via cfe-commits

https://github.com/H-G-Hristov edited 
https://github.com/llvm/llvm-project/pull/77967
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   >