File: 0001-gate-definition-of-symmetric-equality-operators-on-i.patch

package info (click to toggle)
rapidjson 1.1.0%2Bdfsg2-7.4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,264 kB
  • sloc: cpp: 18,852; ansic: 2,434; python: 235; xml: 182; sh: 83; makefile: 10; javascript: 2
file content (29 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 64faab2e9235ed51f37ef592010b35fc7f7324ec Mon Sep 17 00:00:00 2001
From: Kent Ross <k@mad.cash>
Date: Mon, 14 Mar 2022 12:25:26 -0700
Subject: [PATCH] gate definition of symmetric equality operators on impl, not
 lib

These operators call themselves recursively if C++20 semantics are present in the compiler, regardless of standard library support for the operator; therefore the test should be on __cpp_impl_three_way_comparison, not __cpp_lib_[...].

This fixes the Value.EqualtoOperator test when the language standard is set to C++20 and the standard library does not yet define the library support macro.
---
 include/rapidjson/document.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index 0c4c229e..4f1e2467 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -1092,7 +1092,7 @@ public:
      */
     template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
 
-#ifndef __cpp_lib_three_way_comparison
+#ifndef __cpp_impl_three_way_comparison
     //! Equal-to operator with arbitrary types (symmetric version)
     /*! \return (rhs == lhs)
      */
-- 
2.45.2