diff options
Diffstat (limited to 'absl/base/macros.h')
-rw-r--r-- | absl/base/macros.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/absl/base/macros.h b/absl/base/macros.h index 5b43d7c2bf3b..ca6207927e75 100644 --- a/absl/base/macros.h +++ b/absl/base/macros.h @@ -191,10 +191,11 @@ enum LinkerInitialized { // This macro is inspired by // https://akrzemi1.wordpress.com/2017/05/18/asserts-in-constexpr-functions/ #if defined(NDEBUG) -#define ABSL_ASSERT(expr) (false ? (void)(expr) : (void)0) +#define ABSL_ASSERT(expr) \ + (false ? static_cast<void>(expr) : static_cast<void>(0)) #else -#define ABSL_ASSERT(expr) \ - (ABSL_PREDICT_TRUE((expr)) ? (void)0 \ +#define ABSL_ASSERT(expr) \ + (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ : [] { assert(false && #expr); }()) // NOLINT #endif |