Skip to content

Commit 373af2e

Browse files
Abseil Teamcopybara-github
authored andcommitted
Provide a better error message when ASSERT and SKIP macros are used in methods that return values
PiperOrigin-RevId: 788083860 Change-Id: I91583f0c0f816144428d56ab07e58fd035c532d1
1 parent 32f9f4c commit 373af2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

googletest/include/gtest/gtest.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,6 +1610,8 @@ GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
16101610
double val1, double val2,
16111611
double abs_error);
16121612

1613+
using GoogleTest_NotSupported_OnFunctionReturningNonVoid = void;
1614+
16131615
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
16141616
// A class that enables one to stream messages to assertion macros
16151617
class GTEST_API_ AssertHelper {
@@ -1621,7 +1623,8 @@ class GTEST_API_ AssertHelper {
16211623

16221624
// Message assignment is a semantic trick to enable assertion
16231625
// streaming; see the GTEST_MESSAGE_ macro below.
1624-
void operator=(const Message& message) const;
1626+
GoogleTest_NotSupported_OnFunctionReturningNonVoid operator=(
1627+
const Message& message) const;
16251628

16261629
private:
16271630
// We put our data in a struct so that the size of the AssertHelper class can

0 commit comments

Comments
 (0)