mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 10:17:39 +02:00
@ -1,6 +1,11 @@
|
|||||||
ArduinoJson: change log
|
ArduinoJson: change log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
----
|
||||||
|
|
||||||
|
* Forbid `deserializeJson(JsonArray|JsonObject, ...)` (issue #2135)
|
||||||
|
|
||||||
v7.2.0 (2024-09-18)
|
v7.2.0 (2024-09-18)
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -34,3 +34,6 @@ build_should_fail(variant_as_char)
|
|||||||
|
|
||||||
add_executable(assign_char assign_char.cpp)
|
add_executable(assign_char assign_char.cpp)
|
||||||
build_should_fail(assign_char)
|
build_should_fail(assign_char)
|
||||||
|
|
||||||
|
add_executable(deserialize_object deserialize_object.cpp)
|
||||||
|
build_should_fail(deserialize_object)
|
||||||
|
12
extras/tests/FailingBuilds/deserialize_object.cpp
Normal file
12
extras/tests/FailingBuilds/deserialize_object.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// ArduinoJson - https://arduinojson.org
|
||||||
|
// Copyright © 2014-2024, Benoit BLANCHON
|
||||||
|
// MIT License
|
||||||
|
|
||||||
|
#include <ArduinoJson.h>
|
||||||
|
|
||||||
|
// See issue #2135
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
JsonObject obj;
|
||||||
|
deserializeJson(obj, "");
|
||||||
|
}
|
@ -24,14 +24,10 @@ struct first_or_void<T, Rest...> {
|
|||||||
|
|
||||||
// A meta-function that returns true if T is a valid destination type for
|
// A meta-function that returns true if T is a valid destination type for
|
||||||
// deserialize()
|
// deserialize()
|
||||||
template <class T, class = void>
|
|
||||||
struct is_deserialize_destination : false_type {};
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct is_deserialize_destination<
|
using is_deserialize_destination =
|
||||||
T, enable_if_t<is_same<decltype(VariantAttorney::getResourceManager(
|
bool_constant<is_base_of<JsonDocument, remove_cv_t<T>>::value ||
|
||||||
detail::declval<T&>())),
|
IsVariant<T>::value>;
|
||||||
ResourceManager*>::value>> : true_type {};
|
|
||||||
|
|
||||||
template <typename TDestination>
|
template <typename TDestination>
|
||||||
inline void shrinkJsonDocument(TDestination&) {
|
inline void shrinkJsonDocument(TDestination&) {
|
||||||
|
@ -13,7 +13,10 @@ struct integral_constant {
|
|||||||
static const T value = v;
|
static const T value = v;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef integral_constant<bool, true> true_type;
|
template <bool B>
|
||||||
typedef integral_constant<bool, false> false_type;
|
using bool_constant = integral_constant<bool, B>;
|
||||||
|
|
||||||
|
using true_type = bool_constant<true>;
|
||||||
|
using false_type = bool_constant<false>;
|
||||||
|
|
||||||
ARDUINOJSON_END_PRIVATE_NAMESPACE
|
ARDUINOJSON_END_PRIVATE_NAMESPACE
|
||||||
|
Reference in New Issue
Block a user