Found some posts here how it is done, and also one with ESP8266 using std::span.
I followed the instructions in the posts, but it seems I am missing something.
I updated gcc
gcc.exe (MinGW-W64 x86_64-ucrt-mcf-seh, built by Brecht Sanders) 13.2.0
Wut? Updating your local GCC installation that’s compiling for x86_64, aka your Desktop, has 0 effect on which toolchain PlatformIO uses for the XTensa32 architecture. PlatformIO strictly decouples the used build toolchain from whatever is regularly installed on your computer. The first thing that would be in order is to upgrade the actual toolchain package: https://registry.platformio.org/tools/espressif/toolchain-xtensa-esp32/versions
Now it builds (strangely no matter if gnu++20 or gnu++2a) , thank you very much!
But now I also get a lot of warnings (multiple pages), f.e.
C:/Users/Inso/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:614:1: warning: ignoring attribute ‘section (“.iram1.24”)’ because it conflicts with previous ‘section (“.iram1.22”)’ [-Wattributes]