Skip to content

Commit 4dc2be8

Browse files
Abseil Teamcopybara-github
authored andcommitted
Inline absl_testing::status_internal::GetStatus
PiperOrigin-RevId: 874305384 Change-Id: Ic8dfea967b5a29bd1a98f2c8a46919f82d130e4f
1 parent f26b591 commit 4dc2be8

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

absl/status/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ cc_library(
172172
":status",
173173
":statusor",
174174
"//absl/base:config",
175+
"//absl/base:core_headers",
175176
"//absl/strings:string_view",
176177
"@googletest//:gtest",
177178
],

absl/status/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ absl_cc_library(
119119
${ABSL_DEFAULT_LINKOPTS}
120120
DEPS
121121
absl::base
122+
absl::core_headers
122123
absl::status
123124
absl::statusor
124125
absl::strings

absl/status/internal/status_matchers.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#define ABSL_STATUS_INTERNAL_STATUS_MATCHERS_H_
1717

1818
#include <ostream> // NOLINT
19-
#include <string>
2019
#include <type_traits>
2120
#include <utility>
2221

2322
#include "gmock/gmock.h" // gmock_for_status_matchers.h
2423
#include "absl/base/config.h"
24+
#include "absl/base/macros.h"
2525
#include "absl/status/status.h"
2626
#include "absl/status/statusor.h"
2727
#include "absl/strings/string_view.h"
@@ -30,12 +30,20 @@ namespace absl_testing {
3030
ABSL_NAMESPACE_BEGIN
3131
namespace status_internal {
3232

33-
inline const absl::Status& GetStatus(const absl::Status& status) {
33+
// TODO(b/323927127): Remove ABSL_REFACTOR_INLINE once callers are cleaned up
34+
// and move it into a namespace like adl_barrier without types to avoid
35+
// accidental ADL.
36+
ABSL_REFACTOR_INLINE inline const absl::Status& GetStatus(
37+
const absl::Status& status) {
3438
return status;
3539
}
3640

41+
// TODO(b/323927127): Remove ABSL_REFACTOR_INLINE once callers are cleaned up
42+
// and move it into a namespace like adl_barrier without types to avoid
43+
// accidental ADL.
3744
template <typename T>
38-
inline const absl::Status& GetStatus(const absl::StatusOr<T>& status) {
45+
ABSL_REFACTOR_INLINE const absl::Status& GetStatus(
46+
const absl::StatusOr<T>& status) {
3947
return status.status();
4048
}
4149

0 commit comments

Comments
 (0)