We are using stdlibc++ with clang because libc++ is lagging behind - specifically it does not implement std::expected type. On top of this, clang 17 does not seem to support all concept features required by std::expected implementation available in stdlibc++ (see discussion in r/cpp for more details). As a workaround I crossed my fingers and added -D__cpp_concepts=202002 -Wno-builtin-macro-redefined to CMakeLists.txt. This is rather ugly hack and the clang compiler would be in the right to miscompile any affected code (e.g. possible UB).
Since we have already rewritten the most difficult chunks of expected as fn::expected in this project, we should just finish the job, remove the dependency on #include <expected> and finally remove the hacky -D__cpp_concepts=202002.
We are using
stdlibc++
with clang becauselibc++
is lagging behind - specifically it does not implementstd::expected
type. On top of this, clang 17 does not seem to support all concept features required bystd::expected
implementation available instdlibc++
(see discussion in r/cpp for more details). As a workaround I crossed my fingers and added-D__cpp_concepts=202002 -Wno-builtin-macro-redefined
toCMakeLists.txt
. This is rather ugly hack and the clang compiler would be in the right to miscompile any affected code (e.g. possible UB).Since we have already rewritten the most difficult chunks of
expected
asfn::expected
in this project, we should just finish the job, remove the dependency on#include <expected>
and finally remove the hacky-D__cpp_concepts=202002
.