]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: Fix use of auto prototype, it is a non std extension
authorWillem Jan Withagen <wjw@digiware.nl>
Fri, 1 Mar 2019 20:36:26 +0000 (21:36 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Fri, 1 Mar 2019 20:36:26 +0000 (21:36 +0100)
Clang complains:
In file included from /home/jenkins/workspace/ceph-master/src/msg/Message.cc:128:
In file included from /home/jenkins/workspace/ceph-master/src/messages/MFSMap.h:20:
/home/jenkins/workspace/ceph-master/src/mds/FSMap.h:330:49: error: 'auto' not allowed in function prototype
  void modify_filesystem(fs_cluster_id_t fscid, auto&& fn)
                                                ^~~~
/home/jenkins/workspace/ceph-master/src/mds/FSMap.h:341:37: error: 'auto' not allowed in function prototype
  void modify_daemon(mds_gid_t who, auto&& fn)
                                    ^~~~

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/mds/FSMap.h

index 36d024c2e36e718e31e809927b1ca6302ad9a727..199b2cf8d14875bb4f43fca0ef5820fd4880ce40 100644 (file)
@@ -327,7 +327,8 @@ public:
    * Mutator helper for Filesystem objects: expose a non-const
    * Filesystem pointer to `fn` and update epochs appropriately.
    */
-  void modify_filesystem(fs_cluster_id_t fscid, auto&& fn)
+  template<typename T>
+  void modify_filesystem(fs_cluster_id_t fscid, T&& fn)
   {
     auto& fs = filesystems.at(fscid);
     fn(fs);
@@ -338,7 +339,8 @@ public:
    * Apply a mutation to the mds_info_t structure for a particular
    * daemon (identified by GID), and make appropriate updates to epochs.
    */
-  void modify_daemon(mds_gid_t who, auto&& fn)
+  template<typename T>
+  void modify_daemon(mds_gid_t who, T&& fn)
   {
     const auto& fscid = mds_roles.at(who);
     if (fscid == FS_CLUSTER_ID_NONE) {