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

Non-copy-constructibility tests fail #17

Closed
eyalroz opened this issue Jan 10, 2020 · 4 comments
Closed

Non-copy-constructibility tests fail #17

eyalroz opened this issue Jan 10, 2020 · 4 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Jan 10, 2020

See also issue #16.

The following tests are failing:

bool test1 = ! std::is_copy_constructible
    <strf::constrained_fpe<is_64, facet<0, enable_only_move>>>
    ::value;

bool test3 = ! std::is_copy_constructible
    <strf::facets_pack<facet<0, enable_only_move>>>
    ::value;

bool test5 =  ! std::is_copy_constructible
    < strf::facets_pack
         < strf::constrained_fpe
             < is_64, facet<0, enable_only_move> >>>
    :: value;

bool test7 = ! std::is_move_constructible
    < strf::facets_pack<facet<0, disable_copy_and_move>> >
    ::value;

It's not so clear to me why that's happening, though. Perhaps @robhz786 can help?

@robhz786
Copy link

robhz786 commented Jan 11, 2020

If you declare a copy constructor, then std::is_copy_constructible<your_class>::value is true unconditionally, even if the copy constructor fails to compile. And I don't think it is possible to use any sfinae trick here. The only solution seem to defaulting the constructors ( either by omitting the declaration or by using =default; ). If this is not possible, I think the issue is unsolvable.

https://akrzemi1.wordpress.com/2015/03/02/a-conditional-copy-constructor/

@eyalroz
Copy link
Owner Author

eyalroz commented Jan 11, 2020

@robhz786 : But are we talking about declarations I added?

Oh, I remember there were someplaces I had to replace = default; with manually writing a default ctor, to make it STRF_HD. Maybe that's the cause here?

@robhz786
Copy link

robhz786 commented Jan 11, 2020

@eyalroz Yes, that's the cause.
I created a pull request now. Take a look: #18
Question: What happens if we declare the copy and move constructors with = default; but without STRF_HD ?

eyalroz pushed a commit that referenced this issue Jan 11, 2020
This should have the same effect as defining them as `= default;`
but, hopefully, without the issues we found in CUDACC.
This fixes #17 "Non-copy-constructibility tests fail"
@eyalroz
Copy link
Owner Author

eyalroz commented Jan 14, 2020

All tests now pass.

@eyalroz eyalroz closed this as completed Jan 14, 2020
@eyalroz eyalroz reopened this Jan 14, 2020
eyalroz pushed a commit that referenced this issue Apr 6, 2020
* Made some host-only functions into `STRF_HD` (host-and-device) - especially `get_default()` and `fn()` methods
* Added an `fmt()` result printing to the `kernel_using_cstr_to` kernel of the `write_within_kernel` testcase.

The `write_within_kernel` testcase fails with `fmt()` getting called.
eyalroz pushed a commit that referenced this issue Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants