mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Fixed error expected unqualified-id on GCC 11 (fixes #1622)
				
					
				
			This commit is contained in:
		| @@ -5,6 +5,7 @@ HEAD | ||||
| ---- | ||||
|  | ||||
| * Fixed error `'dummy' may be used uninitialized` on GCC 11 | ||||
| * Fixed error `expected unqualified-id before 'const'` on GCC 11 (issue #1622) | ||||
|  | ||||
| v6.18.3 (2021-07-27) | ||||
| ------- | ||||
|   | ||||
| @@ -12,6 +12,7 @@ link_libraries(ArduinoJson catch) | ||||
| include_directories(Helpers) | ||||
| add_subdirectory(Cpp11) | ||||
| add_subdirectory(Cpp17) | ||||
| add_subdirectory(Cpp20) | ||||
| add_subdirectory(FailingBuilds) | ||||
| add_subdirectory(IntegrationTests) | ||||
| add_subdirectory(JsonArray) | ||||
|   | ||||
							
								
								
									
										29
									
								
								extras/tests/Cpp20/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								extras/tests/Cpp20/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| # ArduinoJson - https://arduinojson.org | ||||
| # Copyright Benoit Blanchon 2014-2021 | ||||
| # MIT License | ||||
|  | ||||
| if(MSVC_VERSION LESS 1910) | ||||
| 	return() | ||||
| endif() | ||||
|  | ||||
| if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) | ||||
| 	return() | ||||
| endif() | ||||
|  | ||||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) | ||||
| 	return() | ||||
| endif() | ||||
|  | ||||
| set(CMAKE_CXX_STANDARD 20) | ||||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||||
|  | ||||
| add_executable(Cpp20Tests | ||||
| 	smoke_test.cpp | ||||
| ) | ||||
|  | ||||
| add_test(Cpp20 Cpp20Tests) | ||||
|  | ||||
| set_tests_properties(Cpp20 | ||||
| 	PROPERTIES | ||||
| 		LABELS 		"Catch" | ||||
| ) | ||||
							
								
								
									
										15
									
								
								extras/tests/Cpp20/smoke_test.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								extras/tests/Cpp20/smoke_test.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| #include <ArduinoJson.h> | ||||
|  | ||||
| #include <catch.hpp> | ||||
| #include <string> | ||||
|  | ||||
| TEST_CASE("C++20 smoke test") { | ||||
|   StaticJsonDocument<128> doc; | ||||
|  | ||||
|   deserializeJson(doc, "{\"hello\":\"world\"}"); | ||||
|   REQUIRE(doc["hello"] == "world"); | ||||
|  | ||||
|   std::string json; | ||||
|   serializeJson(doc, json); | ||||
|   REQUIRE(json == "{\"hello\":\"world\"}"); | ||||
| } | ||||
| @@ -45,8 +45,7 @@ class StringAdapter< ::String> { | ||||
| template <> | ||||
| class StringAdapter< ::StringSumHelper> : public StringAdapter< ::String> { | ||||
|  public: | ||||
|   StringAdapter< ::StringSumHelper>(const ::String& s) | ||||
|       : StringAdapter< ::String>(s) {} | ||||
|   StringAdapter(const ::String& s) : StringAdapter< ::String>(s) {} | ||||
| }; | ||||
|  | ||||
| }  // namespace ARDUINOJSON_NAMESPACE | ||||
|   | ||||
| @@ -45,7 +45,7 @@ class StringAdapter<const char*> { | ||||
| template <int N> | ||||
| class StringAdapter<const char[N]> : public StringAdapter<const char*> { | ||||
|  public: | ||||
|   StringAdapter<const char[N]>(const char* s) : StringAdapter<const char*>(s) {} | ||||
|   StringAdapter(const char* s) : StringAdapter<const char*>(s) {} | ||||
| }; | ||||
|  | ||||
| }  // namespace ARDUINOJSON_NAMESPACE | ||||
|   | ||||
		Reference in New Issue
	
	Block a user