You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mpgen: Work around c++20 / capnproto 0.8 incompatibility
The kj/string.h header installed by capnproto 0.8 doesn't work well when
compiling with -std=c++20 or later because the reverse StringPtr/char*
comparison function it provides is broken in c++20:
inline bool operator==(const char* a, const StringPtr& b) { return b == a; }
Before C++20 this would implicitly convert `a` to a StringPtr and call the
StringPtr::operator== method. But starting with C++20 it actually calls itself
recursively and either loops forever or crashes.
This problem was fixed upstream by
capnproto/capnproto#1170 in Cap'n Proto 0.9.0. Avoid
the problem here for older versions by just not using the operator. A CI job
testing older versions is added in the next commit to avoid similar breakage in
the future.
0 commit comments