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

<generator>: Revert unnecessary ADL firewall for _Gen_promise_base #4827

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Jul 10, 2024

In #4464 _Gen_promise_base was made a nested non-template class of a class template.

However, per [basic.lookup.argdep]/3,2, the template arguments of a base class don't furtherly contribute to ADL, so the original implementation strategy should already be ADL-proof for promise_type.

This PR reverts unnecessary changes and adds test cases to ensure that promise_type is already ADL-proof. Actually, exsiting unqualified function calls are also doing this.

Drive-by change: remove one occurrence of the _NODISCARD_FRIEND workaround, following up #4782. Superseded by #4834.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner July 10, 2024 23:44
@StephanTLavavej StephanTLavavej added enhancement Something can be improved generator C++23 generator labels Jul 11, 2024
@StephanTLavavej StephanTLavavej self-assigned this Jul 11, 2024
@AlexGuteniev

This comment was marked as resolved.

}

#ifndef _M_CEE // TRANSITION, VSO-1659496
Copy link
Member

Choose a reason for hiding this comment

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

No change requested: Technically, this isn't necessary because <generator> is C++23, and /clr is currently limited to C++20. However, following the usual pattern seems fine.

@StephanTLavavej StephanTLavavej merged commit cf0bf1a into microsoft:feature/generator Jul 17, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks! ⚡ 🔥

@frederick-vs-ja frederick-vs-ja deleted the overly-adl-proof-generator branch July 18, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved generator C++23 generator
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants