[PATCH] D101899: std::forward_list::swap to use propagate_on_container_swap for noexcept specification

Hyundeok Park via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 5 05:17:55 PDT 2021


airglow923 created this revision.
airglow923 added a project: libc++.
airglow923 requested review of this revision.
Herald added a project: clang.
Herald added subscribers: libcxx-commits, cfe-commits.
Herald added a reviewer: libc++.

This revision is a patch for bug 50224 <https://bugs.llvm.org/show_bug.cgi?id=50224>.

The current implementation of `std::forward_list::swap` uses `propagate_on_container_move_assignment` for `noexcept` specification. This revision has been made in an attempt to change it to `propagate_on_container_swap`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101899

Files:
  clang/lib/Format/Format.cpp
  libcxx/include/forward_list


Index: libcxx/include/forward_list
===================================================================
--- libcxx/include/forward_list
+++ libcxx/include/forward_list
@@ -534,7 +534,7 @@
 #if _LIBCPP_STD_VER >= 14
         _NOEXCEPT;
 #else
-        _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
+        _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<__node_allocator>::value);
 #endif
 protected:
@@ -599,7 +599,7 @@
 #if _LIBCPP_STD_VER >= 14
         _NOEXCEPT
 #else
-        _NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
+        _NOEXCEPT_(!__node_traits::propagate_on_container_swap::value ||
                     __is_nothrow_swappable<__node_allocator>::value)
 #endif
 {
Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -3054,7 +3054,7 @@
 
           LLVM_DEBUG(llvm::dbgs() << "Applying child configurations\n");
 
-          for (const auto& MemBuf : llvm::reverse(ChildFormatTextToApply)){
+          for (const auto &MemBuf : llvm::reverse(ChildFormatTextToApply)) {
             auto Ec = parseConfiguration(*MemBuf, &Style, AllowUnknownOptions,
                                          dropDiagnosticHandler);
             // It was already correctly parsed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101899.343006.patch
Type: text/x-patch
Size: 1421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210505/902ea3cf/attachment.bin>


More information about the cfe-commits mailing list