Skip to content

[libc++][vector] Updates LWG3778 status. #99818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

mordante
Copy link
Member

The work was done in a8ae392 which implements parts of

N4258: Cleaning-up noexcept in the Library

However that's paper Summary of Proposed Changes contains
No change in vector

This patch updates the status and as a few NFC cleanups. The fixed version is based on the release page and might be off.

Updates

  • LWG3778 vector missing exception specifications

The work was done in a8ae392 which
implements parts of

  N4258: Cleaning-up noexcept in the Library

However that's paper Summary of Proposed Changes contains
  No change in vector<bool>

This patch updates the status and as a few NFC cleanups.
The fixed version is based on the release page and might be off.

Updates
- LWG3778 vector<bool> missing exception specifications
@mordante mordante requested a review from a team as a code owner July 21, 2024 18:06
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 21, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 21, 2024

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

The work was done in a8ae392 which implements parts of

N4258: Cleaning-up noexcept in the Library

However that's paper Summary of Proposed Changes contains
No change in vector<bool>

This patch updates the status and as a few NFC cleanups. The fixed version is based on the release page and might be off.

Updates

  • LWG3778 vector<bool> missing exception specifications

Full diff: https://github.com/llvm/llvm-project/pull/99818.diff

2 Files Affected:

  • (modified) libcxx/docs/Status/Cxx23Issues.csv (+1-1)
  • (modified) libcxx/include/vector (+3-4)
diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index 50104052effad..5fe602a2f93fb 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -225,7 +225,7 @@
 "`3773 <https://wg21.link/LWG3773>`__","``views::zip_transform`` still requires ``F`` to be ``copy_constructible`` when empty pack", "November 2022","","","|ranges|"
 "`3774 <https://wg21.link/LWG3774>`__","``<flat_set>`` should include ``<compare>``", "November 2022","","","|flat_containers|"
 "`3775 <https://wg21.link/LWG3775>`__","Broken dependencies in the ``Cpp17Allocator`` requirements", "November 2022","","",""
-"`3778 <https://wg21.link/LWG3778>`__","``vector<bool>`` missing exception specifications", "November 2022","","",""
+"`3778 <https://wg21.link/LWG3778>`__","``vector<bool>`` missing exception specifications", "November 2022","|Complete|","3.7",""
 "`3781 <https://wg21.link/LWG3781>`__","The exposition-only alias templates ``cont-key-type`` and ``cont-mapped-type`` should be removed", "November 2022","|Nothing to do|","",""
 "`3782 <https://wg21.link/LWG3782>`__","Should ``<math.h>`` declare ``::lerp``?", "November 2022","|Complete|","17.0",""
 "`3784 <https://wg21.link/LWG3784>`__","std.compat should not provide ``::byte`` and its friends", "November 2022","","",""
diff --git a/libcxx/include/vector b/libcxx/include/vector
index 45980043a3c15..5dfc31e5dbf29 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -170,7 +170,7 @@ public:
 
     vector()
         noexcept(is_nothrow_default_constructible<allocator_type>::value);
-    explicit vector(const allocator_type&);
+    explicit vector(const allocator_type&) noexcept;
     explicit vector(size_type n, const allocator_type& a = allocator_type()); // C++14
     vector(size_type n, const value_type& value, const allocator_type& = allocator_type());
     template <class InputIterator>
@@ -178,8 +178,7 @@ public:
     template<container-compatible-range<bool> R>
       constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
     vector(const vector& x);
-    vector(vector&& x)
-        noexcept(is_nothrow_move_constructible<allocator_type>::value);
+    vector(vector&& x) noexcept;
     vector(initializer_list<value_type> il);
     vector(initializer_list<value_type> il, const allocator_type& a);
     ~vector();
@@ -425,7 +424,7 @@ public:
 #if _LIBCPP_STD_VER <= 14
       _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
 #else
-      _NOEXCEPT
+      noexcept
 #endif
       : __end_cap_(nullptr, __a) {
   }

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming this already has tests.

@mordante mordante merged commit 6cea818 into llvm:main Jul 23, 2024
57 checks passed
@mordante mordante deleted the review/LWG3778 branch July 23, 2024 17:33
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
The work was done in a8ae392 which
implements parts of

  N4258: Cleaning-up noexcept in the Library

However that's paper Summary of Proposed Changes contains
  No change in vector<bool>

This patch updates the status and as a few NFC cleanups. The fixed
version is based on the release page and might be off.

Updates
- LWG3778 vector<bool> missing exception specifications

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251057
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants