Skip to content

Conversation

StephanTLavavej
Copy link
Member

  • Replace _Implicitly_convert_to and _Fake_decay_copy with _Fake_copy_init.
  • Adjust warning suppressions.
    • In <type_traits>, _Is_nothrow_convertible_v isn't declaring any functions, so we don't need to suppress the volatile deprecation warnings about WG21-N4910 [depr.volatile.type]/3.
    • In <xstddef>, we're just declaring _Fake_copy_init() but not calling it, so we don't need to suppress truncation/sign-conversion warnings.
    • However, _Fake_copy_init() returns _Ty, unlike _Implicitly_convert_to which returned void. There's a different warning number about volatile return types that we need to suppress.

As mentioned in #1937's comments, this return type change from void to _Ty has no other effects - the only usage outside of noexcept is already using void_t:

struct _Invoke_convertible<_From, _To, void_t<decltype(_Implicitly_convert_to<_To>(_Returns_exactly<_From>()))>>

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Aug 19, 2022
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner August 19, 2022 00:52
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

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

Thanks Stephan!

@StephanTLavavej StephanTLavavej self-assigned this Aug 20, 2022
@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 2a1b881 into microsoft:main Aug 22, 2022
@StephanTLavavej StephanTLavavej deleted the fake-it-til-you-make-it branch August 22, 2022 21:26
@CaseyCarter
Copy link
Contributor

Thank you for clarifying what's a real copy and a fake copy. No more will we be forced to say things like "It's a fake copy, innit?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants