I have updated in the Arduino IDE 2.3.4 the Espressif ESP32 Core from 3.0.7 to 3.1.1.
With this I get
warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
Has the Cpp default setting been changed?
Can anyone comment on this?
I can't find a manual parameter in the platform.txt.
Hi @Doc_Arduino. It looks like the regression occurred here:
They were not kind enough to explain why they found it necessary to regress from C++23 to C++17 in order to "add Matter component as part of the libs".
It is in the flag file specified by the "@{compiler.sdk.path}/flags/cpp_flags" argument in the compilation command template.
When compiling for an ESP32 board, the file is here:
(note the -std=gnu++17 flag, which overrides the prior -std=gnu++2b flag)
I think that is the best workaround.
Normally I would recommend using the compiler.cpp.extra_flags property to inject the additional flag into the compilation command instead of compiler.cpp.flags, as compiler.cpp.extra_flags was added to the platform for exactly this sort of use case. But unfortunately the developers of the "esp32" boards platform made the poor decision to place the {compiler.cpp.extra_flags} reference before the reference to compiler.cpp.flags in the compilation command template, which makes it impossible to use compiler.cpp.extra_flags to override flags from compiler.cpp.flags (since when a flag is used multiple times, the later occurrence overrides the prior one). So compiler.cpp.extra_flags can't be used.
Also, you must have changed something in the default settings? Since Arduino ESP32 Core Package 3.1.1, C++20 is no longer standard. With Core Package 3.0.7 I did not have to change anything in the compiler flags.
Since it is completely tangential to the subject of your issue report, I recommend instead submitting a dedicated issue about this. The relevant issue tracker would be here:
I haven't dealt with this problem for a long time. I would like to do a complete PR and test it myself beforehand. I have a question about this. In which file(s) do I need to make changes to change the order of execution? Could I get some hints for this?
me-no-dev (GitHub) doesn't seem to have time.
This means that, when using the latest version of the platform, it is no longer necessary to use the platform.local.txt workaround to force the use of C++20.