]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: workaround an ICE of GCC 31470/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 1 Jan 2019 07:49:05 +0000 (15:49 +0800)
committerJason Dillaman <dillaman@redhat.com>
Thu, 7 Nov 2019 19:21:53 +0000 (14:21 -0500)
GCC is somehow annoyed at seeing the combination of decltype and
initializer_list in this place.

See https://tracker.ceph.com/issues/37719 for a semi-related issue.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/object_map/test_mock_LockRequest.cc

index 5f95429acd2ed9dfa01521e41bc017535ac1d904..5954a461e7edef32f9d314b456cf06593c257bf3 100644 (file)
@@ -46,11 +46,12 @@ public:
       entity_name_t entity2(entity_name_t::CLIENT(2));
 
       cls_lock_get_info_reply reply;
-      reply.lockers = decltype(reply.lockers){
-        {rados::cls::lock::locker_id_t(entity1, "cookie1"),
-         rados::cls::lock::locker_info_t()},
-        {rados::cls::lock::locker_id_t(entity2, "cookie2"),
-         rados::cls::lock::locker_info_t()}};
+      reply.lockers.emplace(
+        rados::cls::lock::locker_id_t(entity1, "cookie1"),
+        rados::cls::lock::locker_info_t());
+      reply.lockers.emplace(
+        rados::cls::lock::locker_id_t(entity2, "cookie2"),
+        rados::cls::lock::locker_info_t());
 
       bufferlist bl;
       encode(reply, bl, CEPH_FEATURES_SUPPORTED_DEFAULT);