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

Remove redundant move in test #860

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Remove redundant move in test #860

merged 1 commit into from
Jan 20, 2025

Conversation

hpkfft
Copy link
Contributor

@hpkfft hpkfft commented Jan 15, 2025

An out-of-the box build with Debian trixie (i.e., with g++ 14.2.0) gives the following warning:

warning: redundant move in return statement [-Wredundant-move]
  508 |     m.def("test_type_object_t", [](nb::type_object_t<Struct> h) -> nb::object { return std::move(h); });
      |                                                                                        ~~~~~~~~~^~~

Since the return expression is move-eligible, the move constructor is selected without the std::move.

@wjakob
Copy link
Owner

wjakob commented Jan 20, 2025

So AFAIK I added this std::move() because of a compiler warning saying that I needed an explicit move to avoid using a converting constructor. But I can't repro it anymore. Will merge this for now.

@wjakob wjakob merged commit e134487 into wjakob:master Jan 20, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants