diff --git a/libcxx/test/support/test_comparisons.h b/libcxx/test/support/test_comparisons.h --- a/libcxx/test/support/test_comparisons.h +++ b/libcxx/test/support/test_comparisons.h @@ -30,7 +30,7 @@ // Test all six comparison operations for sanity template -TEST_CONSTEXPR_CXX14 bool testComparisons(const T& t1, const U& t2, bool isEqual, bool isLess) +_LIBCPP_NODISCARD TEST_CONSTEXPR_CXX14 bool testComparisons(const T& t1, const U& t2, bool isEqual, bool isLess) { assert(!(isEqual && isLess) && "isEqual and isLess cannot be both true"); if (isEqual) @@ -84,7 +84,7 @@ // Easy call when you can init from something already comparable. template -TEST_CONSTEXPR_CXX14 bool testComparisonsValues(Param val1, Param val2) +_LIBCPP_NODISCARD TEST_CONSTEXPR_CXX14 bool testComparisonsValues(Param val1, Param val2) { const bool isEqual = val1 == val2; const bool isLess = val1 < val2; @@ -137,7 +137,7 @@ } template -constexpr bool testOrder(const T& t1, const U& t2, Order order) { +_LIBCPP_NODISCARD constexpr bool testOrder(const T& t1, const U& t2, Order order) { bool equal = order == Order::equivalent; if constexpr (std::same_as) equal |= order == Order::equal; @@ -148,7 +148,7 @@ } template -constexpr bool testOrderValues(Param val1, Param val2) { +_LIBCPP_NODISCARD constexpr bool testOrderValues(Param val1, Param val2) { return testOrder(T(val1), T(val2), val1 <=> val2); } @@ -156,7 +156,7 @@ // Test all two comparison operations for sanity template -TEST_CONSTEXPR_CXX14 bool testEquality(const T& t1, const U& t2, bool isEqual) +_LIBCPP_NODISCARD TEST_CONSTEXPR_CXX14 bool testEquality(const T& t1, const U& t2, bool isEqual) { if (isEqual) { @@ -178,7 +178,7 @@ // Easy call when you can init from something already comparable. template -TEST_CONSTEXPR_CXX14 bool testEqualityValues(Param val1, Param val2) +_LIBCPP_NODISCARD TEST_CONSTEXPR_CXX14 bool testEqualityValues(Param val1, Param val2) { const bool isEqual = val1 == val2;