GCC 12's Shiny New C++ Features - More Of C++23 Implemented

Written by Michael Larabel in GNU on 1 May 2022 at 05:31 AM EDT. 5 Comments
With GCC 12.1 due for release in roughly the next week or so, Red Hat's Marek Polacek penned a new blog post this week outlining many of the C++ language improvements to be found in this major GNU Compiler Collection update.

GCC 12 defaults to the C++17 (namely the GNU++17 dialect) by default for C++ but more of C++23 has been implemented in this annual compiler update. Though in GCC 12, both C++20 and C++23 are still considered experimental.

GCC 12 implements C++23's features for if consteval, auto(x), non-literal variables in constexpr functions, multi-dimensional subscript operator, elifdef and elifndef pre-processing directives, extended init-statement, folding of trivial functions, and much more. GCC 12 is also introducing various new and improved compiler warnings.

More details on the C++ improvements to find with the upcoming GCC 12 can be found via the Red Hat Developers' Blog.

There are also static analyzer improvements and much more to enjoy with GCC 12 - stay tuned for my feature recap and more compiler benchmarks soon. In GCC 13 next year they are aiming to have the C++23 support squared away.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week