]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/lba_manager/btree/lba_btree: fix FTBFS on gcc 9 wip-sjust-testing 43016/head
authorSamuel Just <sjust@redhat.com>
Wed, 1 Sep 2021 21:44:14 +0000 (14:44 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 1 Sep 2021 21:44:14 +0000 (14:44 -0700)
gcc-9 doesn't seem to consider interator nothrow move constructible with
the default move constructor implementation yielding the following build
failure:

m/el8/BUILD/ceph-17.0.0-7373-gfc349212/src/seastar/include/seastar/core/future.hh:584:58: error: static assertion failed: Types must be no-throw move constructible
  584 |     static_assert(std::is_nothrow_move_constructible<T>::value,

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/lba_manager/btree/lba_btree.h

index 94e6c736b9b9f025bcd001fa8e01bc549680650d..a822b6dde04134cf3b9746d8a4fb9cac38f1195d 100644 (file)
@@ -29,8 +29,11 @@ public:
 
   class iterator {
   public:
-    iterator(const iterator &) noexcept = default;
-    iterator(iterator &&) noexcept = default;
+    iterator(const iterator &rhs) noexcept :
+      internal(rhs.internal), leaf(rhs.leaf) {}
+    iterator(iterator &&rhs) noexcept :
+      internal(std::move(rhs.internal)), leaf(std::move(rhs.leaf)) {}
+
     iterator &operator=(const iterator &) = default;
     iterator &operator=(iterator &&) = default;
 
@@ -102,8 +105,8 @@ public:
     }
 
   private:
-    iterator() = default;
-    iterator(depth_t depth) : internal(depth - 1) {}
+    iterator() noexcept {}
+    iterator(depth_t depth) noexcept : internal(depth - 1) {}
 
     friend class LBABtree;
     static constexpr uint16_t INVALID = std::numeric_limits<uint16_t>::max();