GCC 11 Will Let You Use -std=c++23 But Without Turning On Any New Features

It was just in September that the C++20 draft was approved as the latest major update to the C++ programming language. The GNU Compiler Collection has near complete coverage of C++20 with still lacking bits of the modules implementation. But while the next major iteration of C++ is still being figured out, GCC 11 will at least honor the compiler flag of "-std=c++23" or "-std=c++2b" but without actually enabling any new functionality over C++20. This is mainly for helping projects that will eventually default to using that flag but will still build cleanly with C++20 level functionality in the upcoming GCC 11 compiler release.
C++23 is expected to bring a more modular standard library, coroutines in the standard library, standardized networking features, a stacktrace library, and more still to be determined. It will be interesting to see what all comes of C++23 and if it ends up being postponed at all with the C++ planning meetings so far being derailed by the pandemic.
In any case, this commit on Tuesday now adds support for -std=c++23 to at least lay the basic groundwork for this next C++ version. GCC 11 stable should be out around the start of the next quarter if their usual release timing keeps up.
8 Comments