Error when build with FPSTR in version 6.2.0 and 6.2.1
Created by: tarzan115
Hi @bblanchon I got a problem with version 6.2.0 and 6.2.1 but it works with 6.1.0
here is a small code
#include <ArduinoJson.h>
const char TEST_1[] PROGMEM = "TEST_1";
const char TEST_2[] PROGMEM = "TEST_2";
const char *json = "{\"TEST_1\":{\"TEST_2\":[1,2,3]}}";
/*
{
"TEST_1": {
"TEST_2":[
1,2,3
]
}
}
*/
void parseJSON()
{
DynamicJsonDocument doc(200);
deserializeJson(doc, json);
JsonObject root = doc.as<JsonObject>();
JsonArray TEST = root[FPSTR(TEST_1)][FPSTR(TEST_2)];
return;
}
void setup()
{
parseJSON();
return;
}
void loop()
{
return;
}
and here is the log
In file included from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../Strings/StringTypes.hpp:23:0,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../JsonVariantComparisons.hpp:9,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../JsonVariantBase.hpp:8,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../JsonVariant.hpp:13,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/ValueSaver.hpp:7,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./JsonArrayData.hpp:8,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/JsonArray.hpp:7,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/DynamicJsonDocument.hpp:7,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:9,
from D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,
from D:\Documents\WorkSpace\Arduino\testJson\testJson.ino:1:
D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../Strings/ZeroTerminatedRamString.hpp: In instantiation of 'const bool ArduinoJson::Internals::IsString<__FlashStringHelper*>::value':
D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/JsonObjectSubscript.hpp:124:5: required by substitution of 'template<class TString> typename ArduinoJson::Internals::enable_if<ArduinoJson::Internals::IsString<TString*>::value, const ArduinoJson::Internals::JsonObjectSubscript<const TString*> >::type ArduinoJson::Internals::JsonVariantSubscripts<TImpl>::operator[](const TString*) const [with TString = TString; TImpl = ArduinoJson::Internals::JsonObjectSubscript<const __FlashStringHelper*>] [with TString = __FlashStringHelper]'
D:\Documents\WorkSpace\Arduino\testJson\testJson.ino:22:55: required from here
D:\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./Data/../Strings/ZeroTerminatedRamString.hpp:49:35: error: invalid application of 'sizeof' to incomplete type '__FlashStringHelper'
static const bool value = sizeof(TChar) == 1;
^
exit status 1
Error compiling for board Generic ESP8266 Module.
thank you in advance!