https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101027
kiwixz at outlook dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kiwixz at outlook dot com --- Comment #1 from kiwixz at outlook dot com --- Hello, I encountered the same problem with gcc evaluating the two asio coroutine operands of && even when the left one returned false. See on godbolt: https://godbolt.org/z/Wo8z5PoP3 Expected output (confirmed on clang 12 with libc++): a 0 GCC 11.2 or trunk: a b 0 --- #include <iostream> #include <boost/asio.hpp> namespace asio = boost::asio; asio::awaitable<bool> a() { std::cout << "a\n"; co_return false; } asio::awaitable<bool> b() { std::cout << "b\n"; co_return false; } asio::awaitable<void> f() { std::cout << ((co_await a()) && (co_await b())) << "\n"; } int main() { asio::io_context io; asio::co_spawn(io, f, asio::detached); io.run(); }