| RFC-0283: Add support for C++23 | |
|---|---|
| Status | Accepted |
| Areas |
|
| Description | Update the Fuchsia tree C++ version to C++23 and expand supported SDK C++ versions to include C++23 |
| Issues | |
| Gerrit change | |
| Authors | |
| Reviewers | |
| Date submitted (year-month-day) | 2026-03-19 |
| Date reviewed (year-month-day) | 2026-05-05 |
Summary
Following the process outlined in RFC-0193: Supported C++ Versions, this RFC proposes updating from C++20 to C++23 as the Fuchsia tree C++ version and expanding the set of formally supported C++ versions in the SDK to include C++23.
Motivation
C++20 is the only supported version in the Fuchsia platform, while the SDK supports both C++17 and C++20 according to RFC-0193: Supported C++ Versions and RFC-0258: Update from C++17 to C++20. C++23 introduces a number of new features that significantly improve the ergonomics, but these improvements are currently unavailable to Fuchsia platform developers.
Stakeholders
Facilitator:
- leannogasawara@google.com
Reviewers:
- mcgrathr@google.com
- phosek@google.com
Consulted:
Socialization:
Requirements
- Update the Fuchsia tree C++ version from C++20 to C++23.
- Allow in-tree platform code to rely on C++23 features.
Non-goals
- Make every feature in the C++23 standard immediately available in Fuchsia.
Design
The Fuchsia tree can be already compiled in either C++20 or C++23 modes. This will change the C++ version used by the Fuchsia tree from C++20 to C++23 after which it will no longer be an option to build in-tree (or "platform") code in the C++20 mode.
Implementation
The C++ standard used by the Fuchsia tree is controlled by a build argument. We plan to submit a change that updates the Fuchsia tree C++ version from C++20 to C++23, but ask Fuchsia developers to avoid using C++23 features until the RFC is approved, to preserve the ability to roll back to C++20 if needed.
Performance
N/A
Ergonomics
Access to all C++23 standard library features will reduce boilerplate and improve the C++ language usability.
Backwards Compatibility
Both C++17 and C++20 MUST remain supported in the SDK. The in-tree (or "platform") code which is not part of the SDK API surface can start relying on C++23 features and thus become incompatible with C++17 and C++20.
Security considerations
N/A
Privacy considerations
N/A
Testing
In accordance with RFC-0193, the SDK tests will be built and run in every supported C++ version, now including C++23.
Documentation
The SDK documentation will be updated to reflect that C++23 is officially supported in addition to C++17 and C++20; we will also document the constraints on C++23 feature support available to the SDK users.
C++ in Zircon will be updated to cover supported C++23 features and constraints on their use.