Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redundant move in return statement #57

Open
Spongman opened this issue Nov 7, 2022 · 0 comments
Open

redundant move in return statement #57

Spongman opened this issue Nov 7, 2022 · 0 comments

Comments

@Spongman
Copy link

Spongman commented Nov 7, 2022

@Naios

I get the following when building the current master branch (using cmake). I get the same thing when building my own code using the library, with optimizations enabled:

[0/2] Re-checking globbed directories...
[11/158] Building CXX object test/unit-test/CMakeFiles/test-continuable-single.dir/single/test-continuable-result.cpp.o
In file included from /home/user/continuable/include/continuable/continuable-result.hpp:37,
                 from /home/user/continuable/test/unit-test/single/test-continuable-result.cpp:27:
/home/user/continuable/include/continuable/../continuable/detail/utility/result-trait.hpp: In instantiation of ‘static cti::detail::result_trait<T>::surrogate_t cti::detail::result_trait<T>::wrap(T) [with T = std::shared_ptr<int>; cti::detail::result_trait<T>::surrogate_t = std::shared_ptr<int>]’:
/home/user/continuable/include/continuable/continuable-result.hpp:159:29:   required from ‘cti::result<T>::result(FirstArg&&, Args&& ...) [with FirstArg = std::shared_ptr<int>; Args = {}; T = {std::shared_ptr<int>}]’
/home/user/continuable/test/unit-test/single/test-continuable-result.cpp:256:55:   required from here
/home/user/continuable/include/continuable/../continuable/detail/utility/result-trait.hpp:65:25: warning: redundant move in return statement [-Wredundant-move]
   65 |     return std::move(arg);
      |                         ^
/home/user/continuable/include/continuable/../continuable/detail/utility/result-trait.hpp:65:25: note: remove ‘std::move’ call

Commit Hash 63e3ed4

Steps to Reproduce

mkdir build
cd build
cmake -G Ninja ..
ninja-build

Your Environment

  • OS: centos7
  • Compiler and version: gcc 10.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants