Commit 2526926b by Abseil Team Committed by Copybara-Service

Remove ABSL_HARDENING_ASSERT in AnyInvocable to avoid performance impact in optimized builds

PiperOrigin-RevId: 531301442
Change-Id: Ib5a67f827bf89a66a0a8d24d3191f278566af6c8
parent 67f9650c
......@@ -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
}
......
......@@ -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(); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment