Commit c4cb758
committed
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.1 parent cb170d4 commit c4cb758
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
429 | | - | |
| 428 | + | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| |||
0 commit comments