When I do
C:\Users\Max\.platformio\packages\toolchain-xtensa\bin\xtensa-lx106-elf-g++.exe -v --help
I get
-std=gnu++17 Conform to the ISO 2017 C++ standard with GNU
extensions.
-std=gnu++1y Deprecated in favor of -std=gnu++14. Same as
-std=gnu++14.
-std=gnu++1z Deprecated in favor of -std=gnu++17. Same as
-std=gnu++17.
-std=gnu++20 Conform to the ISO 2020 C++ draft standard with
GNU extensions (experimental and incomplete
support). Same as -std=gnu++2a.
-std=gnu++2a Conform to the ISO 2020 C++ draft standard with
GNU extensions (experimental and incomplete
support).
And further
C:\Users\Max\.platformio\packages\toolchain-xtensa\bin\xtensa-lx106-elf-g++.exe -std=gnu++20 -dM -E -x c++ - < NUL
gives
#define __cplusplus 201709L
So that version of the compiler definitely set the the __cplusplus
macro to the the C++ 17 standard one. Likely because of the above warning that support is incomplete and experimental.