Commit 8de55087 authored by Kenton Varda's avatar Kenton Varda

More GCC fixes.

parent bab217b2
......@@ -30,7 +30,6 @@
#include <kj/refcount.h>
#include <kj/debug.h>
#include <kj/vector.h>
#include <kj/one-of.h>
#include <map>
namespace capnp {
......
......@@ -1712,7 +1712,7 @@ struct WireHelpers {
goto useDefault;
}
setCapabilityPointer(dstSegment, dst,
return setCapabilityPointer(dstSegment, dst,
srcSegment->getArena()->extractCap(StructReader(
srcSegment, ptr,
reinterpret_cast<const WirePointer*>(ptr + src->structRef.dataSize.get()),
......@@ -1727,6 +1727,8 @@ struct WireHelpers {
goto useDefault;
}
}
KJ_UNREACHABLE;
}
static void adopt(SegmentBuilder* segment, WirePointer* ref, OrphanBuilder&& value) {
......
......@@ -115,13 +115,13 @@ private:
inline bool copyVariantFrom(const OneOf& other) {
if (other.is<T>()) {
ctor(*reinterpret_cast<T*>(space), other.get<T>());
tag = typeIndex<T>();
}
return false;
}
void copyFrom(const OneOf& other) {
// Initialize as a copy of `other`. Expects that `this` starts out uninitialized, so the tag
// is invalid.
tag = other.tag;
doAll(copyVariantFrom<Variants>(other)...);
}
......@@ -129,13 +129,13 @@ private:
inline bool moveVariantFrom(OneOf& other) {
if (other.is<T>()) {
ctor(*reinterpret_cast<T*>(space), kj::mv(other.get<T>()));
tag = typeIndex<T>();
}
return false;
}
void moveFrom(OneOf& other) {
// Initialize as a copy of `other`. Expects that `this` starts out uninitialized, so the tag
// is invalid.
tag = other.tag;
doAll(moveVariantFrom<Variants>(other)...);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment