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

<xutility>: ranges::iter_swap is broken #1067

Closed
statementreply opened this issue Jul 21, 2020 · 0 comments · Fixed by #1072
Closed

<xutility>: ranges::iter_swap is broken #1067

statementreply opened this issue Jul 21, 2020 · 0 comments · Fixed by #1072
Labels
bug Something isn't working fixed Something works now, yay!

Comments

@statementreply
Copy link
Contributor

Describe the bug

STL/stl/inc/xutility

Lines 1069 to 1071 in c10ae01

} else if constexpr (_Choice<_Ty1, _Ty2>._Strategy == _St::_Exchange) {
*static_cast<_Ty1&&>(_Val1) =
_Iter_exchange_move(static_cast<_Ty1&&>(_Val1), static_cast<_Ty2&&>(_Val2));

The behavior of this constexpr branch is incorrect.

STL version

https://github.com/microsoft/STL/commit/c10ae01b4d9508eed9d5f059a120ee7223b6ac12

Additional context

This bug causes test failure in #1062.

@CaseyCarter CaseyCarter added bug Something isn't working work in progress labels Jul 21, 2020
CaseyCarter added a commit to CaseyCarter/STL that referenced this issue Jul 21, 2020
...by transposing arguments to `_Iter_exchange_move`.

Fixes microsoft#1067
CaseyCarter added a commit that referenced this issue Jul 30, 2020
...by transposing arguments to `_Iter_exchange_move`.

Fixes #1067
@CaseyCarter CaseyCarter added fixed Something works now, yay! and removed work in progress labels Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants