Skip to content

Commit 2ac5360

Browse files
Abseil Teamliujinye-sys
authored andcommitted
Remove ABSL_HARDENING_ASSERT in AnyInvocable to avoid performance impact in optimized builds
PiperOrigin-RevId: 531301442 Change-Id: Ib5a67f827bf89a66a0a8d24d3191f278566af6c8
1 parent 077de73 commit 2ac5360

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

absl/functional/any_invocable_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ TYPED_TEST_P(AnyInvTestRvalue, NonConstCrashesOnSecondCall) {
14181418
// Ensure we're still valid
14191419
EXPECT_TRUE(static_cast<bool>(fun)); // NOLINT(bugprone-use-after-move)
14201420

1421-
#if !defined(NDEBUG) || ABSL_OPTION_HARDENED == 1
1421+
#if !defined(NDEBUG)
14221422
EXPECT_DEATH_IF_SUPPORTED(std::move(fun)(7, 8, 9), "");
14231423
#endif
14241424
}

absl/functional/internal/any_invocable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ using CanAssignReferenceWrapper = TrueAlias<
824824
auto* invoker = this->invoker_; \
825825
if (!std::is_const<QualifiedTestType>::value && \
826826
std::is_rvalue_reference<QualifiedTestType>::value) { \
827-
ABSL_HARDENING_ASSERT([this]() { \
827+
ABSL_ASSERT([this]() { \
828828
/* We checked that this isn't const above, so const_cast is safe */ \
829829
const_cast<Impl*>(this)->invoker_ = InvokedAfterMove; \
830830
return this->HasValue(); \

0 commit comments

Comments
 (0)