]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: avoid aggregate-initializing IsWriteOpVisitor 27039/head
authorWillem Jan Withagen <wjw@digiware.nl>
Fri, 8 Mar 2019 13:59:09 +0000 (14:59 +0100)
committerPrashant D <pdhange@redhat.com>
Tue, 19 Mar 2019 02:09:28 +0000 (22:09 -0400)
Clang 8 complains about missing dtor, and this circumvents this problem.
```
/home/jenkins/workspace/ceph-master/src/librbd/io/ImageDispatchSpec.cc:136:48:
error: temporary of type 'boost::static_visitor<bool>' has protected
destructor
   return boost::apply_visitor(IsWriteOpVisitor{}, m_request);
                                                ^
/home/jenkins/workspace/ceph-master/src/librbd/io/ImageDispatchSpec.cc:152:28:
note: in instantiation of member function
'librbd::io::ImageDispatchSpec<librbd::ImageCtx>::is_write_op' requested
here
template class librbd::io::ImageDispatchSpec<librbd::ImageCtx>;
                            ^
/usr/local/include/boost/variant/static_visitor.hpp:53:5: note: declared
protected here
     ~static_visitor() = default;
     ^
1 error generated.
gmake[2]: *** [src/librbd/CMakeFiles/rbd_internal.dir/build.make:895:
src/librbd/CMakeFiles/rbd_internal.dir/io/ImageDispatchSpec.cc.o] Error 1
```

The details of the problem are explained in more detail in:
https://github.com/ceph/ceph/pull/26301/commits/09870d7a083913b5a3830ba8b0be04d0b0996aca

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
(cherry picked from commit 1d7b291874b65770c0f0a56f2df59326687e7083)

src/librbd/io/ImageDispatchSpec.cc

index d6794c65ee5679c3df401276fa613e120521fee6..ca69a48ac493141a47b45d5b288ca74350b3997a 100644 (file)
@@ -84,7 +84,7 @@ void ImageDispatchSpec<I>::fail(int r) {
 
 template <typename I>
 bool ImageDispatchSpec<I>::is_write_op() const {
-  return boost::apply_visitor(IsWriteOpVisitor{}, m_request);
+  return boost::apply_visitor(IsWriteOpVisitor(), m_request);
 }
 
 template <typename I>