C++ 202a ISO C++ 2020 In this implementation the -std=gnu++2a or -std=c++2a flag must be used to enable language and library features. See dialect options. The pre-defined symbol __cplusplus is used to check for the presence of the required flag. This section describes the C++20 and library TS support in the GCC 9 series. The following table lists new library features that have been accepted into the C++2a working draft. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Status" column indicates the first version of GCC that contains an implementation of this feature (if it has been implemented). The "SD-6 Feature Test" column shows the corresponding macro or header from SD-6: Feature-testing recommendations for C++. C++ 2020 Implementation Status Library Feature Proposal Status SD-6 Feature Test Endian just Endian P0463R1 8.1 Extending make_shared to Support Arrays P0674R1 Floating Point Atomic P0020R6 C++ Synchronized Buffered Ostream P0053R7 Add constexpr modifiers to functions in <algorithm> and <utility> Headers P0202R3 Constexpr for std::complex P0415R1 9.1 Make std::memory_order a scoped enumeration P0439R0 9.1 String Prefix and Suffix Checking P0457R2 9.1 Transformation Trait remove_cvref P0550R2 9.1 nodiscard in the Library P0600R1 9.1 de-pessimize legacy algorithms with std::move P0616R0 9.1 Utility to convert a pointer to a raw pointer P0653R2 8.1 Atomic shared_ptr P0718R2 Deprecate POD P0767R1 Library Support for the Spaceship (Comparison) Operator P0768R1 Treating Unnecessary decay P0777R1 9.1 <span> P0122R7 Extending chrono to Calendars and Time Zones P0355R7 Thou Shalt Not Specialize std Function Templates! P0551R3 Manipulators for C++ Synchronized Buffered Ostream P0753R2 <version> P0754R2 9.1 Comparing Unordered Containers P0809R0 Constexpr iterator requirements P0858R0 9.1 __cpp_lib_string_view >= 201803L and __cpp_lib_array_constexpr >= 201803L Symmetry for spaceship P0905R1 string::reserve Should Not Shrink P0966R1 Atomic Ref P0019R8 Checking for Existence of an Element in Associative Containers P0458R2 9.1 LWG 2511: guaranteed copy elision for piecewise construction P0475R1 7.1 Bit-casting object representations P0476R2 The Curious Case of Padding Bits, Featuring Atomic Compare-and-Exchange P0528R3 Support for contract based programming in C++ P0542R5 Integral power-of-2 operations P0556R3 9.1 Reviewing Deprecated Facilities of C++17 for C++20 P0619R4 Improving the Return Value of Erase-Like Algorithms P0646R1 9.1 __cpp_lib_list_remove_return_type >= 201806L Efficient sized delete for variable sized classes P0722R3 9.1 __cpp_lib_destroying_delete >= 201806L Implicit conversion traits and utility functions P0758R1 9.1 fpos Requirements P0759R1 Note 1 Add shift to <algorithm> P0769R2 Standard Library Specification in a Concepts and Contracts World P0788R3 Constexpr for swap and swap related functions P0879R0 The identity metafunction P0887R1 9.1 explicit(bool) P0892R2 Note 1 Standard Library Concepts P0898R3 Eradicating unnecessarily explicit default constructors from the standard library P0935R0 9.1 Integrating feature-test macros into the C++ WD P0941R2 5.1 constexpr comparison operators for std::array P1023R0 Update The Reference To The Unicode Standard P1025R1 Consistency improvements for <=> and other comparison operators P1120R0 unwrap_ref_decay and unwrap_reference P0318R1 9.1 Simplified partial function application P0356R5 9.1 __cpp_lib_bind_front >= 201811L reference_wrapper for incomplete types P0357R3 9.1 char8_t: A type for UTF-8 characters and strings P0482R6 9.1 __cpp_lib_char8_t >= 201811L Fixing operator>>(basic_istream&, CharT*) (LWG 2499) P0487R1 Utility functions to implement uses-allocator construction P0591R4 9.1 std::scoped_allocator_adaptor changes missing in 9.1.0 P0595R2 std::is_constant_evaluated() P0595R2 9.1 variant and optional should propagate copy/move triviality P0602R4 8.3 A sane variant converting constructor P0608R3 visit<R>: Explicit Return Type for visit P0655R1 9.1 std::function move constructor should be noexcept P0771R1 7.2 The One Ranges Proposal P0896R4 P0899R1 - LWG 3016 is not a defect P0899R1 7.1 Heterogeneous lookup for unordered containers P0919R3 <chrono> zero(), min(), and max() should be noexcept P0972R0 9.1 Constexpr in std::pointer_traits P1006R1 9.1 std::assume_aligned P1007R3 9.1 Smart pointer creation with default initialization P1020R1 Misc constexpr bits P1032R1 Should Span be Regular? P1085R2 Editorial Guidance for merging P0019r8 and P0528r3 P1123R0 Note 1 Cleaning up Clause 20 P1148R0 Make stateful allocator propagation more consistent for operator+(basic_string) P1165R1 Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20 P1209R0 9.1 __cpp_lib_erase_if >= 201811L Completing the Rebase of Library Fundamentals, Version 3, Working Draft P1210R0 Alternative Wording for P0907R4 Signed Integers are Two's Complement P1236R1 Remove CommonReference requirement from StrictWeakOrdering (a.k.a Fixing Relations) P1248R1 Improving Completeness Requirements for Type Traits P1285R0 Well-behaved interpolation for numbers and pointers P0811R3 9.1 __cpp_lib_interpolate >= 201902L Missing feature test macros P1353R0 9.1 polymorphic_allocator<> as a vocabulary type P0339R6 9.1 Making std::underlying_type SFINAE-friendly P0340R3 9.1 Make create_directory() Intuitive P1164R1 8.3 Treated as a DR for C++17 Traits for [Un]bounded Arrays P1357R1 9.1 __cpp_lib_bounded_array_traits >= 201902L
Note 1: The changes in the proposal either do not affect the code in libstdc++, or the changes are not required for conformance.
Implementation Specific Behavior For behaviour which is also specified by previous standards, see C++ 1998/2003 Implementation Specific Behavior, C++ 2011 Implementation Specific Behavior and C++ 2017 Implementation Specific Behavior. This section only documents behaviour which is new in the 202a draft.