continuable icon indicating copy to clipboard operation
continuable copied to clipboard

g++ 9/10 compile error on std::variant<cti::work>

Open p4654545 opened this issue 4 years ago • 5 comments

@Naios

This concerns g++ 9.3.0 and 10.0.1

Using cti::work within a variant leads to a compiler error in "struct assert_wrong_copy_assign" in function2.hpp.

Using std::is_copy_constructible_v makes the compiler happy.


Commit Hash

Latest

Expected Behavior

No compiler error

Actual Behavior

I get this error from g++-9:

/root/.conan/data/function2/4.1.0///package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/function2/function2.hpp:1398:60: error: incomplete type 'std::is_copy_constructible<cti::promise_base<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_fixed<32> >, fu2::abi_400::detail::property<true, false, void() &&, void(cti::exception_arg_t, std::__exception_ptr::exception_ptr) &&> >, cti::detail::identity<> > >' used in nested name specifier 1398 | static_assert(!Config::is_owning || !Config::is_copyable || | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 1399 | std::is_copy_constructible<std::decay_t<T>>::value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Steps to Reproduce

compile with g++-9 or 10 a source file with the following content (could not attach):

#include <continuable/continuable.hpp>
#include <variant>
void foo() { std::variant<cti::work> t; }

Your Environment

  • OS: debian bullseye/sid
  • Compiler and version: G++ 9.3.0, 10.0.1
  • Standard library (if non default): {Please write here}

p4654545 avatar Sep 22 '20 18:09 p4654545

my code got ruined, another try:

`#include <continuable/continuable.hpp> #include <variant>

void foo() { std::variant<cti::work> t; }`

p4654545 avatar Sep 22 '20 18:09 p4654545

reopen

p4654545 avatar Sep 22 '20 18:09 p4654545

It resembles this gcc bug

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415

p4654545 avatar Oct 15 '20 21:10 p4654545

Would you accept a pull request on function2 which replaces std::is_copy_constructible by std::is_copy_constructible_v in function2.hpp?

p4654545 avatar Oct 25 '20 10:10 p4654545

function2 is a C++14 lib and std::is_copy_constructible_v is C++17. Probably it is possible to provide a custom is_copy_constructible based on SFINAE when building with GCC for which I would accept a PR.

Naios avatar Oct 25 '20 11:10 Naios