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

[BUG]: MSVC < 2022 doesn't properly handle thrust's member function detector. #1731

Open
3 tasks
alliepiper opened this issue May 10, 2024 · 0 comments
Open
3 tasks
Labels
bug Something isn't working right.

Comments

@alliepiper
Copy link
Collaborator

alliepiper commented May 10, 2024

Is this a duplicate?

Type of Bug

Compile-time Error

Component

Thrust

Describe the bug

See reproducer. This works on other platforms and on MSVC 2022, but 2017 and 2019 fire the static assert.

I tried messing with the implementation a little, but no luck finding an alternative that MSVC was happy with.

Some tests in thrust/testing/memory.cu and thrust/testing/allocator.cu will be disabled until this can be fixed. Search for this issue number to find them.

How to Reproduce

#include <thrust/detail/type_traits/has_member_function.h>

struct foo { void baz(); };

__THRUST_DEFINE_HAS_MEMBER_FUNCTION(has_baz, baz)

static_assert(has_baz<foo, void()>::value, "Cannot detect member.");
>  cl.exe  -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CPP -IC:\cccl\thrust\ -IC:\cccl\cub\ -IC:\cccl\libcudacxx\include\ -c ..\..\test.cpp

..\..\test.cpp(16): error C2338: Cannot detect member.

Tasks

@alliepiper alliepiper added the bug Something isn't working right. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Status: Todo
Development

No branches or pull requests

1 participant