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

Tests: Extract is_permissive.hpp #4442

Merged

Conversation

StephanTLavavej
Copy link
Member

We've accumulated a bunch of test files copy-pasting the machinery used to detect /permissive mode. Let's centralize it.

This is based on test_mdspan_support.hpp, with namespace details renamed to namespace detail (see below). Its PermissiveTestBase and PermissiveTest were nicely named, and it was using inline constexpr bool. Also add is_permissive_v<T>, when we need it to be dependent on a template parameter. We need to include <yvals_core.h> for _INLINE_VAR, since there's some C++14 usage.

test_mdspan_support.hpp: Drive-by change, this file had both namespace details and namespace detail. Standardize on the latter, as it's used everywhere else.

P2136R3_invoke_r: // TRANSITION, DevCom-1457457 is repeated where is_permissive is used, so we can drop the one next to the definition.

This is based on test_mdspan_support.hpp, with `namespace details` renamed to `namespace detail` (see below). Its `PermissiveTestBase` and `PermissiveTest` were nicely named, and it was using `inline constexpr bool`. Also add `is_permissive_v<T>`, when we need it to be dependent on a template parameter. We need to include `<yvals_core.h>` for `_INLINE_VAR`, since there's some C++14 usage.

test_mdspan_support.hpp: Drive-by change, this file had both `namespace details` and `namespace detail`. Standardize on the latter, as it's used everywhere else.

P2136R3_invoke_r: `// TRANSITION, DevCom-1457457` is repeated where `is_permissive` is used, so we can drop the one next to the definition.
@StephanTLavavej StephanTLavavej added the test Related to test code label Mar 4, 2024
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 4, 2024 02:06
@StephanTLavavej StephanTLavavej self-assigned this Mar 6, 2024
@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 6272fd7 into microsoft:main Mar 8, 2024
37 checks passed
@StephanTLavavej StephanTLavavej deleted the cleanups-4-is_permissive branch March 8, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Related to test code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant