From 018a9bc80449d85c0e40fa5215377d8a03264c88 Mon Sep 17 00:00:00 2001 From: Tom Peoples Date: Thu, 19 Sep 2019 17:30:21 +1000 Subject: [PATCH] Removed un-needed calls to std::move These calls were throwing a pessimistic move error and stopping compilation. --- .travis.yml | 8 ++++++++ CHANGELOG.md | 1 + include/updater/csv_file_parser.hpp | 2 +- src/server/api/parameters_parser.cpp | 3 +-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91e8ce14c..69530f94c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,6 +121,14 @@ matrix: packages: ['libstdc++-4.9-dev'] env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON + - os: linux + compiler: "gcc-9-release" + addons: &gcc9 + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] + env: CCOMPILER='gcc-9' CXXCOMPILER='g++-9' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type' + - os: linux compiler: "gcc-8-release" addons: &gcc8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d75a301..c9ca7a8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Changes from 5.21.0 - Build: - ADDED: optionally build Node `lts` and `latest` bindings [#5347](https://github.com/Project-OSRM/osrm-backend/pull/5347) + - FIXED: pessimistic calls to std::move [#5560](https://github.com/Project-OSRM/osrm-backend/pull/5561) - Features: - ADDED: new waypoints parameter to the `route` plugin, enabling silent waypoints [#5345](https://github.com/Project-OSRM/osrm-backend/pull/5345) - ADDED: data timestamp information in the response (saved in new file `.osrm.timestamp`). [#5115](https://github.com/Project-OSRM/osrm-backend/issues/5115) diff --git a/include/updater/csv_file_parser.hpp b/include/updater/csv_file_parser.hpp index f3221672b..e0c7fabc0 100644 --- a/include/updater/csv_file_parser.hpp +++ b/include/updater/csv_file_parser.hpp @@ -122,7 +122,7 @@ template struct CSVFilesParser util::Log() << "Loaded " << filename << " with " << result.size() << "values"; - return std::move(result); + return result; } catch (const boost::exception &e) { diff --git a/src/server/api/parameters_parser.cpp b/src/server/api/parameters_parser.cpp index a2c6767bd..db935fb5b 100644 --- a/src/server/api/parameters_parser.cpp +++ b/src/server/api/parameters_parser.cpp @@ -45,9 +45,8 @@ boost::optional parseParameters(std::string::iterator &iter, const auto ok = boost::spirit::qi::parse(iter, end, grammar(boost::phoenix::ref(parameters))); - // return move(a.b) is needed to move b out of a and then return the rvalue by implicit move if (ok && iter == end) - return std::move(parameters); + return parameters; } catch (const qi::expectation_failure &failure) {