aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-02-03 21:48:55 +0100
committerGitHub <noreply@github.com>2023-02-03 21:48:55 +0100
commit972491cd956d6cbc6bf718c5319bcd973997dc17 (patch)
treebedd7bd42df8439e21610289c2b6c07371258273
parent1697aab52283cef8bc71530460d543ea5e2f52eb (diff)
parent7761b23b156cb8ed36c84a9942bcb4ac0e1cc636 (diff)
Merge pull request #25867 from vespa-engine/havardpe/make-gcc-11-less-unhappy
avoid using co_await inside other constructs (if/for)
-rw-r--r--vespalib/src/tests/coro/async_io/async_io_test.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/vespalib/src/tests/coro/async_io/async_io_test.cpp b/vespalib/src/tests/coro/async_io/async_io_test.cpp
index 2e783c46e6f..f20dde8b22c 100644
--- a/vespalib/src/tests/coro/async_io/async_io_test.cpp
+++ b/vespalib/src/tests/coro/async_io/async_io_test.cpp
@@ -30,8 +30,10 @@ vespalib::string impl_spec(AsyncIo &async) {
}
Detached self_exiting_run_loop(AsyncIo::SP async) {
- for (size_t i = 0; co_await async->schedule(); ++i) {
+ bool ok = co_await async->schedule();
+ for (size_t i = 0; ok; ++i) {
fprintf(stderr, "self_exiting_run_loop -> current value: %zu\n", i);
+ ok = co_await async->schedule();
}
fprintf(stderr, "self_exiting_run_loop -> exiting\n");
}