From e3b74526ad056facc0a4f3ed86b61b2224733d2d Mon Sep 17 00:00:00 2001 From: faximan <207300+faximan@users.noreply.github.com> Date: Fri, 29 May 2026 15:55:46 +0200 Subject: [PATCH] fix: remove deprecated ATOMIC_VAR_INIT usage The `ATOMIC_VAR_INIT` macro was deprecated in C++20 and removed in C++23. Since `google-cloud-cpp` v3 targets C++17 or newer, we can safely replace it with standard brace initialization `std::atomic cancelled_{false}`. This resolves compilation failures in projects that consume `google-cloud-cpp` headers with C++20 enabled and strict warning settings (like `-Werror` combined with `-Wdeprecated-pragma`). --- google/cloud/internal/future_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/internal/future_impl.h b/google/cloud/internal/future_impl.h index 6e7e1c6f5fbcf..23fb11151f795 100644 --- a/google/cloud/internal/future_impl.h +++ b/google/cloud/internal/future_impl.h @@ -483,7 +483,7 @@ class future_shared_state final { // NOLINT(readability-identifier-naming) std::unique_ptr> continuation_; // Allow users "cancel" the future with the given callback. - std::atomic cancelled_ = ATOMIC_VAR_INIT(false); + std::atomic cancelled_{false}; std::function cancellation_callback_; };