From 7c03b80ef26eef1b34775b035b66a2531d917595 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 13 Jun 2024 09:28:19 -0700 Subject: Use ABSL_UNREACHABLE() instead of equivalent PiperOrigin-RevId: 643024432 Change-Id: Id07aa18d186291442f7b6f3c68ef8dd6cc20b434 --- absl/types/internal/variant.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'absl') diff --git a/absl/types/internal/variant.h b/absl/types/internal/variant.h index 40f57c40..4cb15f29 100644 --- a/absl/types/internal/variant.h +++ b/absl/types/internal/variant.h @@ -273,20 +273,7 @@ struct UnreachableSwitchCase { template [[noreturn]] static VisitIndicesResultT Run( Op&& /*ignored*/) { -#if ABSL_HAVE_BUILTIN(__builtin_unreachable) || \ - (defined(__GNUC__) && !defined(__clang__)) - __builtin_unreachable(); -#elif defined(_MSC_VER) - __assume(false); -#else - // Try to use assert of false being identified as an unreachable intrinsic. - // NOTE: We use assert directly to increase chances of exploiting an assume - // intrinsic. - assert(false); // NOLINT - - // Hack to silence potential no return warning -- cause an infinite loop. - return Run(std::forward(op)); -#endif // Checks for __builtin_unreachable + ABSL_UNREACHABLE(); } }; -- cgit v1.2.3