Commit cfd813e4 authored by Kenton Varda's avatar Kenton Varda

Fix clang 5 build and warnings.

parent bea712bd
......@@ -152,7 +152,7 @@ Lexer::Lexer(Orphanage orphanageParam, ErrorReporter& errorReporter)
auto& commaDelimitedList = arena.copy(p::transform(
p::sequence(tokenSequence, p::many(p::sequence(p::exactChar<','>(), tokenSequence))),
[this](kj::Array<Orphan<Token>>&& first, kj::Array<kj::Array<Orphan<Token>>>&& rest)
[](kj::Array<Orphan<Token>>&& first, kj::Array<kj::Array<Orphan<Token>>>&& rest)
-> kj::Array<kj::Array<Orphan<Token>>> {
if (first == nullptr && rest == nullptr) {
// Completely empty list.
......@@ -231,7 +231,7 @@ Lexer::Lexer(Orphanage orphanageParam, ErrorReporter& errorReporter)
p::oneOf(sequence(p::exactChar<'\xff'>(), p::exactChar<'\xfe'>()),
sequence(p::exactChar<'\xfe'>(), p::exactChar<'\xff'>()),
sequence(p::exactChar<'\x00'>())),
[this, &errorReporter](Location loc) -> kj::Maybe<Orphan<Token>> {
[&errorReporter](Location loc) -> kj::Maybe<Orphan<Token>> {
errorReporter.addError(loc.begin(), loc.end(),
"Non-UTF-8 input detected. Cap'n Proto schema files must be UTF-8 text.");
return nullptr;
......@@ -275,7 +275,7 @@ Lexer::Lexer(Orphanage orphanageParam, ErrorReporter& errorReporter)
));
auto& statement = arena.copy(p::transformWithLocation(p::sequence(tokenSequence, statementEnd),
[this](Location loc, kj::Array<Orphan<Token>>&& tokens, Orphan<Statement>&& statement) {
[](Location loc, kj::Array<Orphan<Token>>&& tokens, Orphan<Statement>&& statement) {
auto builder = statement.get();
auto tokensBuilder = builder.initTokens(tokens.size());
for (uint i = 0; i < tokens.size(); i++) {
......
......@@ -599,7 +599,7 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, ErrorReporter& errorReporterP
builder.initApplication().adoptParams(kj::mv(params.value));
return result;
})))),
[this](Orphan<Expression>&& base, kj::Array<Orphan<Expression>>&& suffixes)
[](Orphan<Expression>&& base, kj::Array<Orphan<Expression>>&& suffixes)
-> Orphan<Expression> {
// Apply all the suffixes to the base expression.
uint startByte = base.getReader().getStartByte();
......@@ -773,7 +773,7 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, ErrorReporter& errorReporterP
// Parse an ordinal followed by an optional colon, or no ordinal but require a colon.
auto& ordinalOrColon = arena.copy(p::oneOf(
p::transform(p::sequence(parsers.ordinal, p::optional(op("!")), p::optional(op(":"))),
[this](Orphan<LocatedInteger>&& ordinal,
[](Orphan<LocatedInteger>&& ordinal,
kj::Maybe<kj::Tuple<>> exclamation,
kj::Maybe<kj::Tuple<>> colon)
-> kj::Tuple<kj::Maybe<Orphan<LocatedInteger>>, bool, bool> {
......@@ -966,7 +966,7 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, ErrorReporter& errorReporterP
auto& annotationTarget = arena.copy(p::oneOf(
identifier,
p::transformWithLocation(op("*"),
[this](kj::parse::Span<List<Token>::Reader::Iterator> location) {
[](kj::parse::Span<List<Token>::Reader::Iterator> location) {
// Hacky...
return Located<Text::Reader>("*",
location.begin()->getStartByte(),
......
......@@ -126,7 +126,7 @@ struct EzRpcClient::Impl {
: context(EzRpcContext::getThreadLocal()),
setupPromise(context->getIoProvider().getNetwork()
.parseAddress(serverAddress, defaultPort)
.then([readerOpts](kj::Own<kj::NetworkAddress>&& addr) {
.then([](kj::Own<kj::NetworkAddress>&& addr) {
return connectAttach(kj::mv(addr));
}).then([this, readerOpts](kj::Own<kj::AsyncIoStream>&& stream) {
clientContext = kj::heap<ClientContext>(kj::mv(stream),
......
......@@ -161,13 +161,13 @@ template <typename ServerType>
typename ServerType::Serves::Client membrane(
kj::Own<ServerType> inner, kj::Own<MembranePolicy> policy) {
return membrane(Capability::Client(kj::mv(inner)), kj::mv(policy))
.castAs<typename ServerType::Serves::Client>();
.castAs<typename ServerType::Serves>();
}
template <typename ServerType>
typename ServerType::Serves::Client reverseMembrane(
kj::Own<ServerType> inner, kj::Own<MembranePolicy> policy) {
return reverseMembrane(Capability::Client(kj::mv(inner)), kj::mv(policy))
.castAs<typename ServerType::Serves::Client>();
.castAs<typename ServerType::Serves>();
}
namespace _ { // private
......
......@@ -983,7 +983,7 @@ private:
// Make a promise which resolves to `replacement` as soon as the `Disembargo` comes back.
auto embargoPromise = paf.promise.then(
kj::mvCapture(replacement, [this](kj::Own<ClientHook>&& replacement) {
kj::mvCapture(replacement, [](kj::Own<ClientHook>&& replacement) {
return kj::mv(replacement);
}));
......
......@@ -167,7 +167,7 @@ TEST(Async, Chain) {
Promise<int> promise2 = evalLater([&]() -> int { return 321; });
auto promise3 = promise.then([&](int i) {
return promise2.then([&loop,i](int j) {
return promise2.then([i](int j) {
return i + j;
});
});
......
......@@ -735,7 +735,7 @@ Maybe<Own<Event>> ChainPromiseNode::fire() {
KJ_IF_MAYBE(exception, intermediate.exception) {
// There is an exception. If there is also a value, delete it.
kj::runCatchingExceptions([&,this]() { intermediate.value = nullptr; });
kj::runCatchingExceptions([&]() { intermediate.value = nullptr; });
// Now set step2 to a rejected promise.
inner = heap<ImmediateBrokenPromiseNode>(kj::mv(*exception));
} else KJ_IF_MAYBE(value, intermediate.value) {
......
......@@ -1653,7 +1653,7 @@ public:
}
auto timeoutPromise = server.timer.afterDelay(server.settings.pipelineTimeout)
.then([this]() { return false; });
.then([]() { return false; });
auto awaitPromise = httpInput.awaitNextMessage();
return timeoutPromise.exclusiveJoin(kj::mv(awaitPromise))
......
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