File tree Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 8
8
* Fixed error ` [Pe070]: incomplete type is not allowed ` on IAR (issue #1560 )
9
9
* Fixed ` serializeJson(doc, String) ` when allocation fails (issue #1572 )
10
10
* Fixed clang-tidy warnings (issue #1574 , PR #1577 by @armandas )
11
+ * Added fake class ` InvalidConversion<T1,T2> ` to easily identify invalid conversions (issue #1585 )
11
12
12
13
v6.18.0 (2021-05-05)
13
14
-------
Original file line number Diff line number Diff line change @@ -193,6 +193,8 @@ struct Converter<ArrayRef> {
193
193
return ArrayRef (pool, data != 0 ? data->asArray () : 0 );
194
194
}
195
195
196
+ static InvalidConversion<VariantConstRef, ArrayRef> fromJson (VariantConstRef);
197
+
196
198
static bool checkJson (VariantConstRef) {
197
199
return false ;
198
200
}
Original file line number Diff line number Diff line change @@ -265,6 +265,9 @@ struct Converter<ObjectRef> {
265
265
return ObjectRef (pool, data != 0 ? data->asObject () : 0 );
266
266
}
267
267
268
+ static InvalidConversion<VariantConstRef, ObjectRef> fromJson (
269
+ VariantConstRef);
270
+
268
271
static bool checkJson (VariantConstRef) {
269
272
return false ;
270
273
}
Original file line number Diff line number Diff line change @@ -9,4 +9,9 @@ namespace ARDUINOJSON_NAMESPACE {
9
9
template <typename T, typename Enable = void >
10
10
struct Converter ;
11
11
12
+ // clang-format off
13
+ template <typename T1, typename T2>
14
+ class InvalidConversion ; // Error here? See https://arduinojson.org/v6/invalid-conversion/
15
+ // clang-format on
16
+
12
17
} // namespace ARDUINOJSON_NAMESPACE
Original file line number Diff line number Diff line change @@ -342,13 +342,19 @@ struct Converter<VariantRef> {
342
342
static bool toJson (VariantRef src, VariantRef dst) {
343
343
return variantCopyFrom (getData (dst), getData (src), getPool (dst));
344
344
}
345
+
345
346
static VariantRef fromJson (VariantRef src) {
346
347
return src;
347
348
}
349
+
350
+ static InvalidConversion<VariantConstRef, VariantRef> fromJson (
351
+ VariantConstRef);
352
+
348
353
static bool checkJson (VariantRef src) {
349
354
VariantData *data = getData (src);
350
355
return !!data;
351
356
}
357
+
352
358
static bool checkJson (VariantConstRef) {
353
359
return false ;
354
360
}
You can’t perform that action at this time.
0 commit comments