From e2016cdd497674158107189491ee3ee32034dae7 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Sun, 10 May 2020 16:45:19 +0800 Subject: [PATCH] test/bufferlist: test move assignment operator not move constructor "bufferlist move = std::move(bl)" exercises the "move constructor". But the purpose of this test is to verify the functionality of "move assignment operator". So this PR construct "move" first, and then assign rvalue reference to it. Signed-off-by: Changcheng Liu --- src/test/bufferlist.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/bufferlist.cc b/src/test/bufferlist.cc index 9a70e098ba615..f73eec477283f 100644 --- a/src/test/bufferlist.cc +++ b/src/test/bufferlist.cc @@ -1412,7 +1412,8 @@ TEST(BufferList, operator_equal) { // // list& operator= (list&& other) // - bufferlist move = std::move(bl); + bufferlist move; + move = std::move(bl); { std::string dest; move.begin(1).copy(1, dest); -- 2.39.5