From a798392000ecaff96cfa64f07aeb2fcad2a5ed01 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 24 Jul 2026 10:02:16 -0700 Subject: [PATCH] Avoid triggering -Wzero-as-null-pointer-constant in HandleExceptionsInMethodIfSupported() Fixes: #2916 PiperOrigin-RevId: 953422776 Change-Id: Ic5a167e93d611adb184c516a6383dcc119e11fd7 --- googletest/src/gtest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 92ea581f0..55a68c0aa 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -2700,7 +2700,7 @@ Result HandleSehExceptionsInMethodIfSupported(T* object, Result (T::*method)(), } // Runs the given method and catches and reports C++ and/or SEH-style -// exceptions, if they are supported; returns the 0-value for type +// exceptions, if they are supported; returns the default-value for type // Result in case of an SEH exception. template Result HandleExceptionsInMethodIfSupported(T* object, Result (T::*method)(), @@ -2748,7 +2748,7 @@ Result HandleExceptionsInMethodIfSupported(T* object, Result (T::*method)(), TestPartResult::kFatalFailure, FormatCxxExceptionMessage(nullptr, location)); } - return static_cast(0); + return Result(); #else return HandleSehExceptionsInMethodIfSupported(object, method, location); #endif // GTEST_HAS_EXCEPTIONS