GCC 11 Enables Co-Routines Support In C++20 Mode
Written by Michael Larabel in GNU on 16 May 2020 at 06:55 AM EDT. 32 Comments
GNU --
The recently released GCC 10 compiler landed initial coroutines support for this major C++20 feature but wasn't enabled unless explicitly enabling that option.

Now that GCC 10 is out the door, the C++ coroutines functionality is being enabled by default when running in C++20 mode (std=c++20). Thus for next year's GCC 11 release will be working coroutines functionality when C++20 is enabled. And by then the remaining bits of C++20 support in the GNU Compiler Collection should also be ironed out.

C++ coroutines allow for functions to be suspended and resume their execution later while maintaining their state. Coroutines are one of the major language features of C++20 along with concepts, modules, the spaceship operator, memory model improvements, and a lot more.

The C++20 standard will be formally published in the near future after the technical specification was firmed up earlier this year. GCC 10 has much of C++20 in place while for GCC 11 the remaining items are likely to be addressed, including changes like this week seeing coroutines enabled for -std=c++20.

The C++20 features still being worked on for GCC are outlined on the C++ standards status page. Similarly, for those wondering the C++20 status on the LLVM Clang side, there is its status page.
Related News
About The Author
Author picture

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 or contacted via MichaelLarabel.com.

Popular News This Week