diff --git a/README.md b/README.md index 941c67e..2a042f8 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,17 @@ cppstat is a site that lists C and C++ features and their respective support by ## Contributing -cppstat is generated from YAML data files in the root directory. -The files are maintained as a best-effort and contributions are always welcome. +cppstat fetches data from YAML files in the root directory. +The files are maintained as a best-effort and contributions are always welcome. You can contribute in multiple ways. -You can edit these files directly via GitHub's web interface and commit your changes for approval. +**The recommended approach is cppstat's [UI-based editor](https://cppstat.dev/editor/).** -Alternatively, you can [submit a ticket](https://github.com/cdervis/cppstat/issues) for any incorrect or missing information, or feature ideas. +The editor provides search and a clear view of the data, Markdown preview and input validation. It can create a patch, commit, and PR automatically for you with a single click. -If you are a toolchain developer, feel free to request full editorial access. +Alternatively, you can use GitHub's web interface and commit your changes for approval. +Another approach is to [submit a ticket](https://github.com/cdervis/cppstat/issues) for any incorrect or missing information, or feature ideas. + +**If you are a toolchain developer, feel free to request full editorial access.** --- diff --git a/content/atomic-floating-min-max.md b/content/atomic-floating-min-max.md new file mode 100644 index 0000000..6b300c9 --- /dev/null +++ b/content/atomic-floating-min-max.md @@ -0,0 +1,35 @@ +--- +execute: true +--- + +## What It Does + +The `fetch_max`, `fetch_min`, `fetch_fmaximum`, `fetch_fminimum`, `fetch_fmaximum_num`, and `fetch_fminimum_num` +member functions for `std::atomic` and `std::atomic_ref` make it possible to atomically +take the minimum or maximum of two floating-point numbers. +`std::fmaximum`, `std::fmaximum_num`, `std::fminimum`, and `std::fminimum_num` +are also added to ``, providing non-atomic counterparts. + +## Why It Matters + +By utilizing hardware support, +floating-point minimum and maximum can have much better performance than existing code +which uses `compare_exchange_weak` in a loop, +especially with high contention. +The new `` functions imported from C23 are also generally useful, +and implement operations from the ISO/IEC 60559 standard. + +## Example + +```cpp +#include +#include + +std::atomic x = 0.5; + +int main() { + std::println("{}", x.fetch_max(0)); // prints 0.5, no update + std::println("{}", x.fetch_max(1)); // prints 0.5, x = 1 + std::println("{}", x.load()); // prints 1 +} +``` diff --git a/content/disallow-return-temporary-glvalue.md b/content/disallow-return-temporary-glvalue.md new file mode 100644 index 0000000..502c43e --- /dev/null +++ b/content/disallow-return-temporary-glvalue.md @@ -0,0 +1,33 @@ +--- +execute: false +--- + +## What It Does + +`&&` and `const&` references can bind to temporary objects. +With this change, this is no longer permitted when binding the result of a function +to a temporary object. + +## Why It Matters + +Binding the result of a function to a temporary object creates a reference that immediately dangles. +Disallowing it prevents the user from running into undefined behavior by accident. + +## Example + +```cpp +int&& f1() { + return 42; // error +} +const double& f2() { + static int x = 42; + return x; // error +} + +auto&& id(auto&& r) { + return static_cast(r); +} +int&& f3() { + return id(42); // OK, but probably a bug +} +``` diff --git a/content/expansion-statements-library-support.md b/content/expansion-statements-library-support.md new file mode 100644 index 0000000..7fbfb50 --- /dev/null +++ b/content/expansion-statements-library-support.md @@ -0,0 +1,73 @@ +--- +execute: true +--- + +## What It Does + +`std::integer_sequence` can now be used in `template for` to conveniently write a loop +where the loop index is a `constexpr` variable. Additionally it can be used to create a +`constexpr` pack in the current function scope through structured bindings. + +This is made possible by implementing the tuple protocol for `std::integer_sequence` ( +specializing `std::tuple_size` + `std::tuple_element` and providing overloads for `get`). + +## Why It Matters + +These changes obsolete the common metaprogramming idiom of using an immediately invoked lambda +expression to introduce a pack of constant indices. This is especially interesting when operating +on multiple packs (or tuple-likes) of equal size at the same time. + +This change has intended symbiotic effects with +- P1306 expansion statements (`template for`) +- P2662 pack indexing (`Pack...[Idx]`) +- P1061 structured bindings can introduce a pack + P2686 constexpr structured bindings +- P3096 function parameter reflection (IILE trick cannot be used here) + + +## Example + +```cpp +#include +#include +#include + + +// before C++26 +template +bool is_eq_iile(std::tuple lhs, std::tuple rhs) { + return [&](std::index_sequence) { + return ((get(lhs) == get(rhs)) && ...); + }(std::index_sequence_for()); +} + +// with structured bindings +template +bool is_eq_fold(std::tuple lhs, std::tuple rhs) { + static constexpr auto [...Idx] = std::index_sequence_for(); + return ((get(lhs) == get(rhs)) && ...); +} + +// with expansion statements +template +bool is_eq_template_for(std::tuple lhs, std::tuple rhs) { + template for (constexpr auto Idx : std::index_sequence_for()) { + if (get(lhs) != get(rhs)) { + return false; + } + } + return true; +} + +int main() { + auto tup = std::tuple{1, 3.14, "hello"}; + auto tup2 = std::tuple{2, 3.14, "hell"}; + + assert(!is_eq_iile(tup, tup2)); + assert(!is_eq_fold(tup, tup2)); + assert(!is_eq_template_for(tup, tup2)); + + assert(is_eq_iile(tup, tup)); + assert(is_eq_fold(tup, tup)); + assert(is_eq_template_for(tup, tup)); +} +``` diff --git a/content/more-constexpr-cmath.md b/content/more-constexpr-cmath.md new file mode 100644 index 0000000..e976f3d --- /dev/null +++ b/content/more-constexpr-cmath.md @@ -0,0 +1,27 @@ +--- +execute: false +--- + +## What It Does + +Most functions in the `` and `` headers are made `constexpr`. + +## Why It Matters + +Historically, while arithmetic expressions such as addition and multiplication +between floating-point operands could be used in constant expressions, +common mathematical functions such as `std::sqrt` or `std::pow` couldn't be. +This meant that some computations had to be done unnecessarily at runtime, +or the user had to re-implement a `constexpr` version +of the ``functions themselves. +The same applies to the corresponding functions in ``. + +## Example + +```cpp +#include +#include + +constexpr double sqrt_10 = std::sqrt(10); +constexpr std::complex i = std::sqrt(std::complex(-1)); +``` diff --git a/content/oxford-variadic-comma.md b/content/oxford-variadic-comma.md new file mode 100644 index 0000000..f7671d3 --- /dev/null +++ b/content/oxford-variadic-comma.md @@ -0,0 +1,28 @@ +--- +execute: false +--- + +## What It Does + +This proposal makes use of a variadic ellipsis (`...`) deprecated, +if it is not separated by a comma from previous parameters. + +## Why It Matters + +Without a separating comma, +users can confuse whether `...` refers to a parameter pack +or to "C-style" variadic arguments. +The lack of a comma also prevents using syntax such as `int...` for new features, +without changing the meaning of existing code. + +## Example + +```cpp +void f(int...); // deprecated +void g(int, ...); // OK, also valid in C +void h(...); // OK, also valid in C + +void i(auto...); // OK, declares a function parameter pack +void j(auto......); // deprecated +void k(auto..., ...); // OK +``` diff --git a/features_c23.yaml b/features_c23.yaml index 21280df..240aa98 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -140,10 +140,11 @@ features: - Clang 13 - MSVC 14.40 - Xcode 13.3 - - desc: "Type change of [u8 string literals](https://en.cppreference.com/w/c/language/string_literal.html)" + - desc: "Type change of [u8 string literals](https://en.cppreference.com/w/c/language/string_literal.html) to `char8_t[]`" paper: N2653 support: - GCC 13 + - Clang 19 - desc: "`[[maybe_unused]]` for labels" paper: N2662 support: diff --git a/features_cpp17.yaml b/features_cpp17.yaml index 83b603a..5bc2b02 100644 --- a/features_cpp17.yaml +++ b/features_cpp17.yaml @@ -902,33 +902,22 @@ features: - desc: "Elementary string conversions (`std::to_chars()` and `std::from_chars()`)" paper: P0067 lib: true - support: - - GCC 8 (partial) - - GCC 11 - - Clang 7 (partial) - - Clang 14 (partial) - - Clang 20 (partial) - - MSVC 14.14 (partial) - - MSVC 14.15 (partial) - - MSVC 14.16 (partial) - - MSVC 14.24 - - Xcode 10 (partial) - - Xcode 14.3 (partial) + support: [GCC 8 (partial), GCC 11, Clang 7 (partial), Clang 14 (partial), Clang 20 (partial), MSVC 14.14 (partial), MSVC 14.15 (partial), MSVC 14.16 (partial), MSVC 14.24, Xcode 10 (partial), Xcode 14.3 (partial)] hints: - target: GCC 8 msg: "No support for floating-point types, only integer types." - target: Clang 7 - msg: "Adds `std::to_chars()` support for `float` and `double`." + msg: "Adds `std::to_chars()` and `std::from_chars()` support for integer types." - target: Clang 14 - msg: "Adds `std::from_chars()` support for `float` and `double`." + msg: "Adds only `std::to_chars()` support for `float` and `double`." - target: Clang 20 - msg: "Support is complete except for `long double`." + msg: "Adds `std::from_chars()` support for `float` and `double`. Support is complete except for `long double`.\n\nIn total, the current status is:\n\n| Type | `to_chars` | `from_chars` |\n|------------------|------------|--------------|\n| integers | libc++ 7 | libc++ 7 |\n| `float`/`double` | libc++ 14 | libc++ 20 |\n| `long double` | - | - |\n\n---\n\n**Note**: Calling both functions with `long double` falls back to the `double` overload." - target: MSVC 14.14 msg: "No support for floating-point types, only integer types." - target: MSVC 14.15 msg: "Adds `std::from_chars()` support for `float` and `double`." - target: MSVC 14.16 - msg: 'Adds shortest round-trip decimal overloads of floating-point `std::to_chars()`, e.g. `"%.8e"` and `"%.16e"`.' + msg: "Adds shortest round-trip decimal overloads of floating-point `std::to_chars()`, e.g. `\"%.8e\"` and `\"%.16e\"`." - target: Xcode 10 msg: "No support for floating-point types, only integer types." - target: Xcode 14.3 diff --git a/features_cpp23.yaml b/features_cpp23.yaml index b7a227f..d6a7dec 100644 --- a/features_cpp23.yaml +++ b/features_cpp23.yaml @@ -597,7 +597,7 @@ features: - desc: "Heterogeneous erasure overloads for associative containers" paper: P2077 lib: true - support: [MSVC 14.32] + support: [GCC 16, MSVC 14.32] ftm: - name: __cpp_lib_associative_heterogeneous_erasure value: 202110L @@ -1010,7 +1010,7 @@ features: paper: P1264 lib: true support: - - GCC ? + - GCC - Clang 9 - MSVC - Xcode 12 @@ -1239,6 +1239,7 @@ features: paper: P2438 lib: true support: + - GCC 16 - Clang 16 - MSVC 14.34 - Xcode 15 diff --git a/features_cpp26.yaml b/features_cpp26.yaml index 78a0e10..6906b35 100644 --- a/features_cpp26.yaml +++ b/features_cpp26.yaml @@ -207,6 +207,7 @@ features: - desc: "Atomic minimum/maximum" paper: P0493 lib: true + support: [GCC 16] ftm: - name: __cpp_lib_atomic_min_max value: 202403L @@ -214,6 +215,7 @@ features: - desc: "Extending associative containers with the remaining heterogeneous overloads" paper: P2363 lib: true + support: [GCC 16] ftm: - name: __cpp_lib_associative_heterogeneous_insertion value: 202306L @@ -243,7 +245,7 @@ features: lib: true support: [GCC 14] ftm: - - name: _cpp_lib_text_encoding + - name: __cpp_lib_text_encoding value: 202306L - desc: "`std::function_ref`: type-erased callable reference" @@ -309,8 +311,10 @@ features: - desc: "More constexpr for `` and ``" paper: P1383 + summary: "More mathematical functions are now `constexpr`, such as `std::sqrt`." + content: more-constexpr-cmath.md lib: true - support: [GCC 4.6] + support: [GCC 4.6 (partial)] ftm: - name: __cpp_lib_constexpr_cmath value: 202306L @@ -510,6 +514,7 @@ features: - desc: "Remove `std::basic_string::reserve()` from C++26" paper: P2870 + summary: "The overload of `std::basic_string::reserve()` with no parameters is removed. It used to be a poor substitute for `std::basic_string::shrink_to_fit()`." lib: true support: [Clang 18, Xcode 16] @@ -576,6 +581,7 @@ features: - desc: "Disallow binding a returned [glvalue](https://en.cppreference.com/w/cpp/language/value_category.html#glvalue) to a temporary" paper: P2748 + content: disallow-return-temporary-glvalue.md support: - GCC 14 - Clang 19 @@ -639,7 +645,7 @@ features: - desc: "Undeprecate `std::polymorphic_allocator::destroy()` for C++26" paper: P2875 lib: true - support: [Clang 15, MSVC 14.41] + support: [GCC 14.3, Clang 15, MSVC 14.41] - desc: "Remove deprecated strstreams from C++26" paper: P2867 @@ -682,6 +688,7 @@ features: - desc: "Formatting of `filesystem::path` (`std::formatter`)" paper: P2845 lib: true + support: [GCC 16] ftm: - name: __cpp_lib_format_path value: 202403L @@ -909,6 +916,8 @@ features: - desc: "The Oxford variadic comma" paper: P3176 support: [GCC 15, Clang 20] + summary: "Variadic ellipsis parameters (`...`) without a separating comma are deprecated, such as `int...`." + content: oxford-variadic-comma.md - desc: "Retiring niebloids" paper: P3136 @@ -968,6 +977,7 @@ features: - desc: "`constexpr` for `std::uninitialized_default_construct()`" paper: P3369 lib: true + support: [GCC 15] ftm: - name: __cpp_lib_raw_memory_algorithms value: 202411L @@ -1022,6 +1032,7 @@ features: - desc: "Contracts for C++ (``)" paper: P2900 summary: "Contracts let you specify preconditions, postconditions, and assertions that document and enforce function requirements." + support: [GCC 16] ftm: - name: __cpp_contracts value: 202502L @@ -1370,6 +1381,10 @@ features: - desc: "Rename `std::observable()` to `std::observable_checkpoint()`, and add a feature-test macro" paper: P3641 lib: true + ftm: + - name: __cpp_lib_observable_checkpoint + value: 202506L + support: [GCC 16] - desc: "`std::string::subview()`" paper: P3044 @@ -1404,6 +1419,7 @@ features: - desc: "`std::mdspan::at()`" paper: P3383 lib: true + support: [GCC 16] - desc: "Inspecting `std::exception_ptr`" paper: P2927 @@ -1480,6 +1496,8 @@ features: - desc: "Atomic floating-point min/max" paper: P3008 + summary: "Adds atomic minimum/maximum operations between floating-point types, as well as non-atomic `` functions." + content: atomic-float-min-max.md lib: true ftm: - name: __cpp_lib_atomic_min_max @@ -1575,11 +1593,12 @@ features: - desc: "Future-proof `submdspan_mapping`" paper: P3663 lib: true + support: [GCC 16] - desc: "Make `std::optional` trivially copyable" paper: P3836 lib: true - support: [Clang 22] + support: [GCC 16, Clang 22] - desc: "When Do You Know `execution::connect()` Doesn’t Throw?" paper: P3388 @@ -1587,7 +1606,11 @@ features: - desc: "Rename `std::nontype`, and make it broadly useful" paper: P3774 + summary: "`std::nontype_t` and `std::nontype` are renamed to `std::constant_arg_t` and `std::constant_arg`, respectively." lib: true + ftm: + - name: __cpp_lib_function_ref + value: 202511L - desc: "Remove `evaluation_exception()` from contract-violation handling for C++26" paper: P3819 @@ -1595,11 +1618,16 @@ features: - desc: "Library Support for Expansion Statements" paper: P1789 + summary: "Specializes `std::tuple_size`, `std::tuple_element`, and `std::get` for `std::integer_sequence` to make it usable in expansion statements and structured bindings." + content: expansion-statements-library-support.md lib: true - support: [Clang 22] + support: [Clang 22 (hint)] ftm: - name: __cpp_lib_integer_sequence value: 202511L + hints: + - target: Clang 22 + msg: "Currently not usable due to pending core language changes. See [CWG3135](https://cplusplus.github.io/CWG/issues/3135.html) for details." keywords: ["reflection"] - desc: "Missing deduction guide from `simd::mask` to `simd::vec`" @@ -1636,3 +1664,4 @@ features: - desc: "Optimize for `std::optional` in range adaptors" paper: P3913 lib: true + support: [GCC 16] diff --git a/toolchain_xcode.yaml b/toolchain_xcode.yaml index 02eebfe..1a0131f 100644 --- a/toolchain_xcode.yaml +++ b/toolchain_xcode.yaml @@ -492,3 +492,10 @@ infos: apple_clang: 17.0.0 (clang-1700.6.3.2) refs: - https://developer.apple.com/documentation/xcode-release-notes/xcode-26_2-release-notes + + - name: Xcode 26.3 + released: February 26, 2026 + requires: macOS 15.6 (Sequoia) + apple_clang: 17.0.0 (clang-1700.6.4.2) + refs: + - https://developer.apple.com/documentation/xcode-release-notes/xcode-26_3-release-notes