diff --git a/.travis.yml b/.travis.yml index af737c64..f58bdd3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,11 @@ matrix: sources: ['ubuntu-toolchain-r-test'] packages: ['g++-8'] env: SCRIPT=test _CC=gcc-8 _CXX=g++-8 + - addons: + apt: + sources: ['ubuntu-toolchain-r-test'] + packages: ['g++-9'] + env: SCRIPT=test _CC=gcc-9 _CXX=g++-9 - addons: apt: packages: ['g++-arm-linux-gnueabihf'] diff --git a/CHANGELOG.md b/CHANGELOG.md index dda6808b..558653c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ HEAD * Added `DeserializationOption::Filter` (issue #959) * Added example `JsonFilterExample.ino` +* Fixed "deprecated-copy" warning on GCC 9 (fixes #1184) v6.14.1 (2020-01-27) ------- diff --git a/extras/tests/JsonDocument/BasicJsonDocument.cpp b/extras/tests/JsonDocument/BasicJsonDocument.cpp index 07c6e18e..8524c911 100644 --- a/extras/tests/JsonDocument/BasicJsonDocument.cpp +++ b/extras/tests/JsonDocument/BasicJsonDocument.cpp @@ -11,6 +11,7 @@ using ARDUINOJSON_NAMESPACE::addPadding; class SpyingAllocator { public: + SpyingAllocator(const SpyingAllocator& src) : _log(src._log) {} SpyingAllocator(std::ostream& log) : _log(log) {} void* allocate(size_t n) { diff --git a/src/ArduinoJson/Array/ElementProxy.hpp b/src/ArduinoJson/Array/ElementProxy.hpp index 075ac966..31bab2c0 100644 --- a/src/ArduinoJson/Array/ElementProxy.hpp +++ b/src/ArduinoJson/Array/ElementProxy.hpp @@ -24,6 +24,9 @@ class ElementProxy : public VariantOperators >, FORCE_INLINE ElementProxy(TArray array, size_t index) : _array(array), _index(index) {} + FORCE_INLINE ElementProxy(const ElementProxy& src) + : _array(src._array), _index(src._index) {} + FORCE_INLINE this_type& operator=(const this_type& src) { getUpstreamElement().set(src.as()); return *this; diff --git a/src/ArduinoJson/Object/MemberProxy.hpp b/src/ArduinoJson/Object/MemberProxy.hpp index 68cbe1d8..487ac68f 100644 --- a/src/ArduinoJson/Object/MemberProxy.hpp +++ b/src/ArduinoJson/Object/MemberProxy.hpp @@ -24,6 +24,9 @@ class MemberProxy : public VariantOperators >, FORCE_INLINE MemberProxy(TObject variant, TStringRef key) : _object(variant), _key(key) {} + FORCE_INLINE MemberProxy(const MemberProxy &src) + : _object(src._object), _key(src._key) {} + FORCE_INLINE operator VariantConstRef() const { return getUpstreamMember(); }