From 3a65e2dd7f37684081ad8eb62fb64fbc418c4a47 Mon Sep 17 00:00:00 2001 From: Pave Pimenov Date: Sat, 12 Sep 2020 19:53:06 +0300 Subject: [PATCH 1/2] fix https://github.com/Tencent/rapidjson/issues/1778 (part 1) --- include/rapidjson/schema.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index fc39d06..4e5f217 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -475,12 +475,12 @@ public: AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); - } - if (const ValueType* v = GetMember(value, GetNotString())) { + if (const ValueType* v = GetMember(value, GetNotString())) { schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document); notValidatorIndex_ = validatorCount_; validatorCount_++; + } } // Object @@ -915,7 +915,7 @@ public: } if (additionalPropertiesSchema_) { - if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { + if (context.patternPropertiesSchemaCount > 0) { context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; context.valueSchema = typeless_; context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; From 24ebd51287f7f3f6aca11a3c7cc8eea8110c10ce Mon Sep 17 00:00:00 2001 From: Laurent Stacul Date: Mon, 22 Feb 2021 16:11:42 +0000 Subject: [PATCH 2/2] Fix recursive operator== call in C++20 (#1846) --- include/rapidjson/document.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 028235e..0910122 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1083,6 +1083,7 @@ public: */ template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } +#ifndef __cpp_lib_three_way_comparison //! Equal-to operator with arbitrary types (symmetric version) /*! \return (rhs == lhs) */ @@ -1093,6 +1094,7 @@ public: */ template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } //@} +#endif //!@name Type //@{