Skip to content

Commit 7ab3923

Browse files
authored
chore: migrate from deprecated absl types to std equivalents (#16400)
1 parent f69f92f commit 7ab3923

137 files changed

Lines changed: 442 additions & 455 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module(
2323
bazel_dep(name = "platforms", version = "1.1.0")
2424
bazel_dep(name = "bazel_skylib", version = "1.9.2")
2525
bazel_dep(name = "rules_cc", version = "0.2.17")
26-
bazel_dep(name = "abseil-cpp", version = "20250814.2")
26+
bazel_dep(name = "abseil-cpp", version = "20260526.0")
2727

2828
# For backwards compatibility with WORKSPACE.
2929
# The name "com_google_protobuf" is internally used by @bazel_tools,

examples/api_key.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "absl/strings/str_split.h"
3434
#include <chrono>
3535
#include <iostream>
36+
#include <optional>
3637
#include <string>
3738
#include <thread>
3839
#include <vector>
@@ -147,7 +148,7 @@ void AutoRun(std::vector<std::string> const& argv) {
147148
// When we authenticate with an API key, we do not have (or need)
148149
// credentials. Using a quota project requires credentials, so disable it.
149150
google::cloud::testing_util::ScopedEnvironment overlay(
150-
"GOOGLE_CLOUD_CPP_USER_PROJECT", absl::nullopt);
151+
"GOOGLE_CLOUD_CPP_USER_PROJECT", std::nullopt);
151152

152153
try {
153154
AuthenticateWithApiKey({project_id, key.key_string()});

generator/integration_tests/golden/v1/golden_kitchen_sink_connection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ StreamRange<google::test::admin::database::v1::Response> GoldenKitchenSinkConnec
8484
google::test::admin::database::v1::Request const&) {
8585
return google::cloud::internal::MakeStreamRange<
8686
google::test::admin::database::v1::Response>(
87-
[]() -> absl::variant<Status,
87+
[]() -> std::variant<Status,
8888
google::test::admin::database::v1::Response>{
8989
return Status(StatusCode::kUnimplemented, "not implemented");}
9090
);

generator/integration_tests/golden/v1/internal/golden_kitchen_sink_connection_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ GoldenKitchenSinkConnectionImpl::StreamingRead(google::test::admin::database::v1
184184
GoldenKitchenSinkStreamingReadStreamingUpdater, request);
185185
return internal::MakeStreamRange<google::test::admin::database::v1::Response>(
186186
[resumable = std::move(resumable)]()
187-
-> absl::variant<
187+
-> std::variant<
188188
Status,
189189
google::test::admin::database::v1::Response> {
190190
google::test::admin::database::v1::Response response;

generator/integration_tests/golden/v1/internal/golden_kitchen_sink_metadata_decorator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ GoldenKitchenSinkMetadata::ExplicitRouting1(
175175
{[](google::test::admin::database::v1::ExplicitRoutingRequest const& request) -> std::string const& {
176176
return request.app_profile_id();
177177
},
178-
absl::nullopt},
178+
std::nullopt},
179179
{[](google::test::admin::database::v1::ExplicitRoutingRequest const& request) -> std::string const& {
180180
return request.table_name();
181181
},

generator/integration_tests/golden/v1/internal/golden_kitchen_sink_rest_metadata_decorator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ GoldenKitchenSinkRestMetadata::ExplicitRouting1(
120120
{[](google::test::admin::database::v1::ExplicitRoutingRequest const& request) -> std::string const& {
121121
return request.app_profile_id();
122122
},
123-
absl::nullopt},
123+
std::nullopt},
124124
{[](google::test::admin::database::v1::ExplicitRoutingRequest const& request) -> std::string const& {
125125
return request.table_name();
126126
},

generator/integration_tests/tests/golden_kitchen_sink_client_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ TEST(GoldenKitchenSinkClientTest, StreamingRead) {
239239
Contains("test-only/1.0"));
240240
EXPECT_THAT(request.stream(), "test-only-stream-name");
241241
return google::cloud::internal::MakeStreamRange<Response>(
242-
[]() -> absl::variant<Status, Response> {
242+
[]() -> std::variant<Status, Response> {
243243
return Status(StatusCode::kPermissionDenied, "uh-oh");
244244
});
245245
});

generator/internal/connection_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc<
460460
" $request_type$ const&) {\n"
461461
" return google::cloud::internal::MakeStreamRange<\n"
462462
" $response_type$>(\n"
463-
" []() -> absl::variant<Status,\n"
463+
" []() -> std::variant<Status,\n"
464464
" $response_type$>{\n"
465465
" return Status(StatusCode::kUnimplemented, \"not implemented\");}\n"
466466
" );\n"

generator/internal/connection_impl_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ StreamRange<$response_type$>
363363
$service_name$$method_name$StreamingUpdater, request);
364364
return internal::MakeStreamRange<$response_type$>(
365365
[resumable = std::move(resumable)]()
366-
-> absl::variant<
366+
-> std::variant<
367367
Status,
368368
$response_type$> {
369369
$response_type$ response;

generator/internal/descriptor_utils.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "absl/strings/str_replace.h"
3535
#include "absl/strings/str_split.h"
3636
#include "absl/strings/strip.h"
37-
#include "absl/types/variant.h"
3837
#include "google/api/annotations.pb.h"
3938
#include "google/api/http.pb.h"
4039
#include "google/api/routing.pb.h"

0 commit comments

Comments
 (0)