mirror of
https://github.com/google/googletest.git
synced 2026-07-30 16:26:24 +08:00
Avoid triggering -Wzero-as-null-pointer-constant in HandleExceptionsInMethodIfSupported()
Fixes: #2916 PiperOrigin-RevId: 953422776 Change-Id: Ic5a167e93d611adb184c516a6383dcc119e11fd7
This commit is contained in:
parent
c914e89e2a
commit
a798392000
@ -2700,7 +2700,7 @@ Result HandleSehExceptionsInMethodIfSupported(T* object, Result (T::*method)(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Runs the given method and catches and reports C++ and/or SEH-style
|
// 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.
|
// Result in case of an SEH exception.
|
||||||
template <class T, typename Result>
|
template <class T, typename Result>
|
||||||
Result HandleExceptionsInMethodIfSupported(T* object, Result (T::*method)(),
|
Result HandleExceptionsInMethodIfSupported(T* object, Result (T::*method)(),
|
||||||
@ -2748,7 +2748,7 @@ Result HandleExceptionsInMethodIfSupported(T* object, Result (T::*method)(),
|
|||||||
TestPartResult::kFatalFailure,
|
TestPartResult::kFatalFailure,
|
||||||
FormatCxxExceptionMessage(nullptr, location));
|
FormatCxxExceptionMessage(nullptr, location));
|
||||||
}
|
}
|
||||||
return static_cast<Result>(0);
|
return Result();
|
||||||
#else
|
#else
|
||||||
return HandleSehExceptionsInMethodIfSupported(object, method, location);
|
return HandleSehExceptionsInMethodIfSupported(object, method, location);
|
||||||
#endif // GTEST_HAS_EXCEPTIONS
|
#endif // GTEST_HAS_EXCEPTIONS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user