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

[BUG] parse_variant() may inadvertently move lvalues #589

Closed
TedLyngmo opened this issue Sep 10, 2024 · 0 comments · Fixed by #590
Closed

[BUG] parse_variant() may inadvertently move lvalues #589

TedLyngmo opened this issue Sep 10, 2024 · 0 comments · Fixed by #590

Comments

@TedLyngmo
Copy link
Contributor

Describe the bug
reply.h:312:36: forwarding reference passed to std::move()

To Reproduce
Make sure a non-const lvalue is processed. The

template< class T >
constexpr variant( T&& t )

constructor of the Variant will be used which will forward that to the constructor of the matching type.

Expected behavior
Expecting non-temporaries to be copied instead of moved. That is, use std::forward instead of std::move

TedLyngmo added a commit to TedLyngmo/redis-plus-plus that referenced this issue Sep 10, 2024
reply.h: std::move was used where std::forward should be used

Fixes sewenew#589

Also made move semantics noexcept in connection_pool

Signed-off-by: Ted Lyngmo <[email protected]>
TedLyngmo added a commit to TedLyngmo/redis-plus-plus that referenced this issue Sep 12, 2024
reply.h: std::move was used where std::forward should be used

Fixes sewenew#589

Signed-off-by: Ted Lyngmo <[email protected]>
sewenew pushed a commit that referenced this issue Sep 13, 2024
reply.h: std::move was used where std::forward should be used

Fixes #589

Signed-off-by: Ted Lyngmo <[email protected]>
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 a pull request may close this issue.

1 participant