-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Cap'n Proto versions 0.9.x and 0.10.x are incompatible with clang 16 and later when -std=c++20
is used, causing error:
/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
This was reported by willcl-ark in #194 (comment) and maflcko in #194 (comment)
This error can be avoided by any of the following:
- Upgrading to Cap'n Proto version 1.0 or newer which fixed this in capnproto/capnproto#1618, or applying the patch as done in shell.nix.
- Downgrading to Cap'n Proto version 0.8 or earlier, before capnproto/capnproto#1170 which triggers this issue starting in version 0.9.
- Downgrading to clang-15 or earlier, before P2468R2 which triggers this issue starting in version 16.
- Maybe using GCC (not sure what the status of this is with GCC)
Background
- Libmultiprocess only uses basic Cap'n Proto features, and for the most part doesn't rely on its c++20 behavior, though it did recently work around a c++20 GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53499 in mpgen: Work around c++20 / capnproto 0.8 incompatibility #194
- Cap'n Proto started to improve it's C++20 support in capnproto/capnproto#1170 and capnproto/capnproto#1235 which were both included in version 0.9.0. But unfortunately these changes stopped working well when clang-16 was released because it implemented P2468R2.
- P2468R2 caused the compiler to stop generating reversed
operator==(U,T)
comparisons fromoperator==(T,U)
if anoperator!=(T,U)
comparison was declared. - This issue was fixed in capnproto/capnproto#1618, and the fix was expanded in capnproto/capnproto#1733. Both of these changes are included in Cap'n Proto versions 1.0 and later.
Metadata
Metadata
Assignees
Labels
No labels