From c8512110f3c41e79ae6aaca496fe28ffb288f1e7 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Thu, 20 Jul 2023 20:52:45 -0700 Subject: RESTRICT AUTOMERGE: Explicitly ignore the result of std::async The newer libc++ marks std::async with [[nodiscard]] in C++20 mode. Bug: b/175635923 Test: treehugger Change-Id: Ia222778697ab4241f25e002073b3514c7e106007 --- services/surfaceflinger/SurfaceFlinger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 8c46515bf1..64348a544c 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -6755,7 +6755,7 @@ ftl::SharedFuture SurfaceFlinger::captureScreenCommon( if (captureListener) { // TODO: The future returned by std::async blocks the main thread. Return a chain of // futures to the Binder thread instead. - std::async([=]() mutable { + (void)std::async([=]() mutable { ATRACE_NAME("captureListener is nonnull!"); auto fenceResult = renderFuture.get(); // TODO(b/232535621): Change ScreenCaptureResults to store a FenceResult. -- cgit v1.2.3-59-g8ed1b