aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2025-07-28 11:13:06 -0700
committerCopybara-Service <copybara-worker@google.com>2025-07-28 11:13:39 -0700
commit373af2e3df71599b87a40ce0e37164523849166b (patch)
tree096acf127b0a61833093aca4f08d4daaac84b726
parent32f9f4c82afa4249af66b55278df15c16b3031ea (diff)
downloadgoogletest-main.zip
googletest-main.tar.gz
googletest-main.tar.bz2
Provide a better error message when ASSERT and SKIP macros are used in methods that return valuesHEADmain
PiperOrigin-RevId: 788083860 Change-Id: I91583f0c0f816144428d56ab07e58fd035c532d1
-rw-r--r--googletest/include/gtest/gtest.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index cbe680c..69994ee 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -1610,6 +1610,8 @@ GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
double val1, double val2,
double abs_error);
+using GoogleTest_NotSupported_OnFunctionReturningNonVoid = void;
+
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
// A class that enables one to stream messages to assertion macros
class GTEST_API_ AssertHelper {
@@ -1621,7 +1623,8 @@ class GTEST_API_ AssertHelper {
// Message assignment is a semantic trick to enable assertion
// streaming; see the GTEST_MESSAGE_ macro below.
- void operator=(const Message& message) const;
+ GoogleTest_NotSupported_OnFunctionReturningNonVoid operator=(
+ const Message& message) const;
private:
// We put our data in a struct so that the size of the AssertHelper class can