ned14 / outcome

Provides very lightweight outcome<T> and result<T> (non-Boost edition)
https://ned14.github.io/outcome
Other
676 stars 62 forks source link

Compilation error due to handle::clone using incomplete handle type (C++20) #214

Closed gix closed 4 years ago

gix commented 4 years ago

handle::clone() returns result<handle>, and using C++20 result requires a complete type due to the is_destructible check in type_can_be_used_in_basic_result. But at this point the handle class is still incomplete.

ned14 commented 4 years ago

You surprise me, as I use LLFIO in C++ 20.

Which compiler and standard library? Exact versions please.

gix commented 4 years ago

MSVC 19.24.28314 and clang-cl/clang with a trunk build from last week (clang required fixing the __cpuid lambda in impl/windows/storage_profile.ipp by making the cpuInfo pointer non-const).

Small repro: https://godbolt.org/z/38ijAH

My cmake options are, among others:

-DLLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON
-DCMAKE_CXX_STANDARD=20
ned14 commented 4 years ago

Ok, should be fixed now. If your LLFIO is using Outcome via superbuild into your build directory, you will need to remove the outcome subdirectory within your build directory, and rerun cmake.