From 3892ce151d69971922ae490a751a2c3a06291b7c Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 31 Oct 2025 13:15:53 +0800 Subject: [PATCH] Backport upstream patch to adapt gcc14 https://github.com/Tencent/rapidjson/pull/719 --- ...ve-non-compiling-assignment-operator.patch | 45 +++++++++++++++++++ rapidjson.spec | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Remove-non-compiling-assignment-operator.patch diff --git a/Remove-non-compiling-assignment-operator.patch b/Remove-non-compiling-assignment-operator.patch new file mode 100644 index 0000000..49552de --- /dev/null +++ b/Remove-non-compiling-assignment-operator.patch @@ -0,0 +1,45 @@ +From 3b2441b87f99ab65f37b141a7b548ebadb607b96 Mon Sep 17 00:00:00 2001 +From: Janusz Chorko +Date: Fri, 26 Aug 2016 21:17:38 +0200 +Subject: [PATCH 1/2] Removed non-compiling assignment operator. Fixed #718 + +--- + include/rapidjson/document.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20dfbd..b0f1f70be 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -316,8 +316,6 @@ struct GenericStringRef { + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + +- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } +- + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + + +From 862c39be371278a45a88d4d1d75164be57bb7e2d Mon Sep 17 00:00:00 2001 +From: Janusz Chorko +Date: Fri, 26 Aug 2016 21:26:50 +0200 +Subject: [PATCH 2/2] Explicitly disable copy assignment operator + +--- + include/rapidjson/document.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index b0f1f70be..19f5a6a5f 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -326,6 +326,8 @@ struct GenericStringRef { + //! Disallow construction from non-const array + template + GenericStringRef(CharType (&str)[N]) /* = delete */; ++ //! Copy assignment operator not permitted - immutable type ++ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; + }; + + //! Mark a character pointer as constant string diff --git a/rapidjson.spec b/rapidjson.spec index 636247d..bdb70d4 100644 --- a/rapidjson.spec +++ b/rapidjson.spec @@ -1,13 +1,14 @@ %global debug_package %{nil} Name: rapidjson Version: 1.1.0 -Release: 13 +Release: 14 Summary: small & selft-contained fast JSON parser and generator for C++ License: MIT URL: http://miloyip.github.io/rapidjson Source0: https://github.com/miloyip/rapidjson/archive/v%{version}.tar.gz#/rapidjson-%{version}.tar.gz Patch0000: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch Patch0001: backport-CVE-2024-38517.patch +Patch0002: Remove-non-compiling-assignment-operator.patch BuildRequires: cmake gcc-c++ gtest-devel %ifarch %{valgrind_arches} BuildRequires: valgrind @@ -92,6 +93,9 @@ cd - %doc %{_pkgdocdir} %changelog +* Fri Oct 31 2025 laokz - 1.1.0-14 +- backport patch to adapt gcc14 + * Sat Sep 28 2024 laokz - 1.1.0-13 - let buildrequire:valgrind depend on system macro -- Gitee