diff --git a/paddle/contrib/inference/CMakeLists.txt b/paddle/contrib/inference/CMakeLists.txt
index a4fe10f708..bea30fb673 100644
--- a/paddle/contrib/inference/CMakeLists.txt
+++ b/paddle/contrib/inference/CMakeLists.txt
@@ -13,6 +13,8 @@
 # limitations under the License.
 #
 
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=pessimizing-move")
+
 function(inference_api_test TARGET_NAME TEST_SRC DEP_TEST)
     set(options "")
     set(oneValueArgs "")
diff --git a/paddle/contrib/inference/paddle_inference_api_impl.cc b/paddle/contrib/inference/paddle_inference_api_impl.cc
index 349bd3b403..e7a0b341dd 100644
--- a/paddle/contrib/inference/paddle_inference_api_impl.cc
+++ b/paddle/contrib/inference/paddle_inference_api_impl.cc
@@ -141,7 +141,7 @@ std::unique_ptr<PaddlePredictor> PaddlePredictorImpl::Clone() {
     return nullptr;
   }
   // fix manylinux compile error.
-  return cls;
+  return std::move(cls);
 }
 
 // TODO(panyx0718): Consider merge with Init()?