C++20 features are available since GCC 8. To enable C++20 support, add the command-line parameter -std=c++20 For G++ 9 and later use -std=c++2a Or, to enable GNU extensions in addition to C++20 features, add -std=gnu++20