]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: Fix invalid type inferences
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 10 Nov 2016 19:25:18 +0000 (14:25 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 17 Nov 2016 00:54:31 +0000 (19:54 -0500)
These are big and ugly and could be made ever so much nicer with a C++14
compatibility header providing the *_t variation of the type traits
templates.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc

index 15e76091a77d24b7f0f939cf953dd001c30e8c73..b7ead13b04bb75f84816e288e70ad2f29460a6a8 100644 (file)
@@ -254,7 +254,9 @@ void BootstrapRequest<I>::open_remote_image() {
 template <typename I>
 void BootstrapRequest<I>::handle_open_remote_image(int r) {
   // deduce the class type for the journal to support unit tests
-  typedef typename std::decay<decltype(*I::journal)>::type Journal;
+  using Journal = typename std::decay<
+    typename std::remove_pointer<decltype(std::declval<I>().journal)>
+    ::type>::type;
 
   dout(20) << ": r=" << r << dendl;
 
index 24b98e5ddb50933afcbdceafe9366519a8838016..588e64ec35a65ef2568f9ba6672e61f4a34d3c83 100644 (file)
@@ -120,7 +120,9 @@ void OpenLocalImageRequest<I>::handle_open_image(int r) {
 template <typename I>
 void OpenLocalImageRequest<I>::send_lock_image() {
   // deduce the class type for the journal to support unit tests
-  typedef typename std::decay<decltype(*I::journal)>::type Journal;
+  using Journal = typename std::decay<
+    typename std::remove_pointer<decltype(std::declval<I>().journal)>
+    ::type>::type;
 
   dout(20) << dendl;