diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h index cbb2469..e6bdbd9 100644 --- a/absl/container/flat_hash_map.h +++ b/absl/container/flat_hash_map.h
@@ -361,8 +361,8 @@ // `flat_hash_map`. // // iterator try_emplace(const_iterator hint, - // const init_type& k, Args&&... args): - // iterator try_emplace(const_iterator hint, init_type&& k, Args&&... args): + // const key_type& k, Args&&... args): + // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args): // // Inserts (via copy or move) the element of the specified key into the // `flat_hash_map` using the position of `hint` as a non-binding suggestion
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h index c91cae6..6868e63 100644 --- a/absl/container/node_hash_map.h +++ b/absl/container/node_hash_map.h
@@ -352,8 +352,8 @@ // `node_hash_map`. // // iterator try_emplace(const_iterator hint, - // const init_type& k, Args&&... args): - // iterator try_emplace(const_iterator hint, init_type&& k, Args&&... args): + // const key_type& k, Args&&... args): + // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args): // // Inserts (via copy or move) the element of the specified key into the // `node_hash_map` using the position of `hint` as a non-binding suggestion
diff --git a/absl/functional/BUILD.bazel b/absl/functional/BUILD.bazel index f9f2b9c..dbfa81f 100644 --- a/absl/functional/BUILD.bazel +++ b/absl/functional/BUILD.bazel
@@ -78,9 +78,9 @@ ) cc_test( - name = "function_ref_benchmark", + name = "function_type_benchmark", srcs = [ - "function_ref_benchmark.cc", + "function_type_benchmark.cc", ], copts = ABSL_TEST_COPTS, tags = ["benchmark"],
diff --git a/absl/functional/function_ref_benchmark.cc b/absl/functional/function_type_benchmark.cc similarity index 98% rename from absl/functional/function_ref_benchmark.cc rename to absl/functional/function_type_benchmark.cc index 045305b..1b27eeb 100644 --- a/absl/functional/function_ref_benchmark.cc +++ b/absl/functional/function_type_benchmark.cc
@@ -1,4 +1,4 @@ -// Copyright 2019 The Abseil Authors. +// Copyright 2022 The Abseil Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "absl/functional/function_ref.h" - +#include <functional> #include <memory> +#include <string> #include "benchmark/benchmark.h" #include "absl/base/attributes.h" +#include "absl/functional/function_ref.h" namespace absl { ABSL_NAMESPACE_BEGIN
diff --git a/absl/memory/memory_test.cc b/absl/memory/memory_test.cc index 1990c7b..5d5719b 100644 --- a/absl/memory/memory_test.cc +++ b/absl/memory/memory_test.cc
@@ -548,22 +548,23 @@ TEST(AllocatorTraits, FunctionsMinimal) { int trace = 0; int hint; - TestValue x(&trace); + alignas(TestValue) char buffer[sizeof(TestValue)]; + auto* x = reinterpret_cast<TestValue*>(buffer); MinimalMockAllocator mock; using Traits = absl::allocator_traits<MinimalMockAllocator>; - EXPECT_CALL(mock, allocate(7)).WillRepeatedly(Return(&x)); - EXPECT_CALL(mock, deallocate(&x, 7)); + EXPECT_CALL(mock, allocate(7)).WillRepeatedly(Return(x)); + EXPECT_CALL(mock, deallocate(x, 7)); - EXPECT_EQ(&x, Traits::allocate(mock, 7)); + EXPECT_EQ(x, Traits::allocate(mock, 7)); static_cast<void>(Traits::allocate(mock, 7, static_cast<const void*>(&hint))); - EXPECT_EQ(&x, Traits::allocate(mock, 7, static_cast<const void*>(&hint))); - Traits::deallocate(mock, &x, 7); + EXPECT_EQ(x, Traits::allocate(mock, 7, static_cast<const void*>(&hint))); + Traits::deallocate(mock, x, 7); + EXPECT_EQ(0, trace); + Traits::construct(mock, x, &trace); EXPECT_EQ(1, trace); - Traits::construct(mock, &x, &trace); - EXPECT_EQ(2, trace); - Traits::destroy(mock, &x); - EXPECT_EQ(1, trace); + Traits::destroy(mock, x); + EXPECT_EQ(0, trace); EXPECT_EQ(std::numeric_limits<size_t>::max() / sizeof(TestValue), Traits::max_size(mock));
diff --git a/absl/status/statusor.h b/absl/status/statusor.h index d6ebdc2..a6d2911 100644 --- a/absl/status/statusor.h +++ b/absl/status/statusor.h
@@ -477,7 +477,7 @@ // StatusOr<T>::ok() // // Returns whether or not this `absl::StatusOr<T>` holds a `T` value. This - // member function is analagous to `absl::Status::ok()` and should be used + // member function is analogous to `absl::Status::ok()` and should be used // similarly to check the status of return values. // // Example: