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

Implement LWG-4169 std::atomic<T>'s default constructor should be constrained #5128

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #5123.

Perhaps this should be backported to old modes as we backported WG21-P0883R2.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner November 24, 2024 16:45
@CaseyCarter
Copy link
Contributor

Perhaps this should be backported to old modes as we backported WG21-P0883R2.

Yes, this change shouldn't be conditioned on language mode.

@CaseyCarter CaseyCarter added the LWG Library Working Group issue label Nov 24, 2024
stl/inc/atomic Outdated Show resolved Hide resolved
Also avoid inheriting constructors and additional copy.

This reverts commit e682b08.
stl/inc/atomic Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Nov 25, 2024
Copy link
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not content to leave well enough alone, I've pushed a commit to replace the conditional_t<is_reference_v<_Ty>, _Ty, const _TVal&> parameter type of the _Atomic_storage converting constructors to const _Ty&. They are the same type when _Ty is not an rvalue reference.

These are overkill. The constructors are ill-formed if `_Ty` is an rvalue reference type, and they were ill-formed before the latest change to the parameter types.
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit b60bb78 into microsoft:main Dec 5, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

☢️ 👷 🪄

@frederick-vs-ja frederick-vs-ja deleted the lwg-4169 branch December 5, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LWG Library Working Group issue
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

LWG-4169 std::atomic<T>'s default constructor should be constrained
3 participants