From 8868a54d5f52bb444f6beda19abbf78e6619b9d1 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Wed, 30 May 2018 17:34:08 +0800 Subject: [PATCH] use flags to fix the compile problem --- paddle/contrib/inference/CMakeLists.txt | 2 ++ paddle/contrib/inference/paddle_inference_api_impl.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 PaddlePredictorImpl::Clone() { return nullptr; } // fix manylinux compile error. - return cls; + return std::move(cls); } // TODO(panyx0718): Consider merge with Init()? -- GitLab