summaryrefslogtreecommitdiff
path: root/absl/functional
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-05-11 14:04:11 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-05-11 14:05:07 -0700
commit2526926b9275076b03159e7e0a9f1f32b9ed8d09 (patch)
treebf28a9f3ec83de9009c7f612fc47b80c5f5aa512 /absl/functional
parent67f9650c93a4fa04728a5b754ae8297d2c55d898 (diff)
Remove ABSL_HARDENING_ASSERT in AnyInvocable to avoid performance impact in optimized builds
PiperOrigin-RevId: 531301442 Change-Id: Ib5a67f827bf89a66a0a8d24d3191f278566af6c8
Diffstat (limited to 'absl/functional')
-rw-r--r--absl/functional/any_invocable_test.cc2
-rw-r--r--absl/functional/internal/any_invocable.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/absl/functional/any_invocable_test.cc b/absl/functional/any_invocable_test.cc
index 10a4dee5..a740faa6 100644
--- a/absl/functional/any_invocable_test.cc
+++ b/absl/functional/any_invocable_test.cc
@@ -1418,7 +1418,7 @@ TYPED_TEST_P(AnyInvTestRvalue, NonConstCrashesOnSecondCall) {
// Ensure we're still valid
EXPECT_TRUE(static_cast<bool>(fun)); // NOLINT(bugprone-use-after-move)
-#if !defined(NDEBUG) || ABSL_OPTION_HARDENED == 1
+#if !defined(NDEBUG)
EXPECT_DEATH_IF_SUPPORTED(std::move(fun)(7, 8, 9), "");
#endif
}
diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h
index b6a38e37..d41b7e56 100644
--- a/absl/functional/internal/any_invocable.h
+++ b/absl/functional/internal/any_invocable.h
@@ -824,7 +824,7 @@ using CanAssignReferenceWrapper = TrueAlias<
auto* invoker = this->invoker_; \
if (!std::is_const<QualifiedTestType>::value && \
std::is_rvalue_reference<QualifiedTestType>::value) { \
- ABSL_HARDENING_ASSERT([this]() { \
+ ABSL_ASSERT([this]() { \
/* We checked that this isn't const above, so const_cast is safe */ \
const_cast<Impl*>(this)->invoker_ = InvokedAfterMove; \
return this->HasValue(); \