]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: avoid creating temporary with protected dtor
authorKefu Chai <kchai@redhat.com>
Sat, 11 Jan 2020 08:37:17 +0000 (16:37 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 11 Jan 2020 15:12:27 +0000 (23:12 +0800)
to address the compiler error from clang 9.0.1:

../src/crimson/os/cyanstore/cyan_collection.cc:16:34: error: temporary of type 'boost::intrusive_ref_counter<Object, boost::thread_unsafe_counter>' has protected destructor
  return new crimson::os::Object{};
                                 ^
/opt/ceph/include/boost/smart_ptr/intrusive_ref_counter.hpp:157:30: note: declared protected here
    BOOST_DEFAULTED_FUNCTION(~intrusive_ref_counter(), {})
                             ^

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/cyanstore/cyan_collection.cc

index 206e902bb3a8c4ad24c6c98419ddc28e7e177bc4..f44234e845a0023dfdf856f67ea78f4181b6cf47 100644 (file)
@@ -13,7 +13,7 @@ Collection::~Collection() = default;
 
 Collection::ObjectRef Collection::create_object() const
 {
-  return new crimson::os::Object{};
+  return new crimson::os::Object;
 }
 
 Collection::ObjectRef Collection::get_object(ghobject_t oid)