Our build baseline was updated from 12.0.1 to 18.1.8 on 3 Nov 2025:
https://git.libreoffice.org/lode/commit/429de780a7a88fbc278dbf1488171f3758d78cd3

As of writing this, our builders have also been updated.

This unlocks some new C++ features, notably ranges.

Resources to help confirm what features are available:
https://git.libreoffice.org/core/+/master/README.md#the-build-chain-and-runtime-baselines
https://en.cppreference.com/w/cpp/compiler_support.html
https://cppstat.dev/
https://developer.apple.com/xcode/cpp/

From the Apple C++ support page, we can see the main Ranges library feature is supported by our Xcode 14.3 baseline: https://developer.apple.com/xcode/cpp/#:~:text=P0896R4

There are additions to ranges features in C++23, but most of them would require further compiler bumps on Linux and macOS. So consult the C++20 proposal papers on what specific features you can use.

The new and in-progress cppstat site offers rather convenient features to filter the mass of features. We can use compiler version filters like these and check the individual C++ standard releases:
GCC: <=12
Clang: <=18
Xcode: <=14.3
(seems tricky or not possible to filter with MSVC, so have to just eyeball them or Ctrl+F and highlight - VS 2026 has version 19.50+)

In C++17 we can see Searchers, std::apply() and std::sample() are available and std::from_chars() can now be used with float and double.

Some unlocked ones in C++20 are

- Access checking on specializations https://wg21.link/P0692
- Coroutines (despite the yellow colour for "partial", for our case the support is full) https://wg21.link/P0912
- Permit conversions to arrays of unknown bound https://wg21.link/P0388
- using enum https://wg21.link/P1099
- Implicit move for more local objects and rvalue references https://wg21.link/P1825
- Extending std::make_shared() to support arrays https://wg21.link/P0674
- Library support for operator<=> (<compare>) https://wg21.link/P0768
- std::bit_cast() https://wg21.link/P0476
- constexpr for std::swap() and swap related functions https://wg21.link/P0879
- Concepts library https://wg21.link/P0898
- std::assume_aligned() https://wg21.link/P1007
- constexpr std::string https://wg21.link/P0426 https://wg21.link/P1032 https://wg21.link/P0980
- constexpr std::vector https://wg21.link/P1004
- Safe integral comparisons https://wg21.link/P0586

(interestingly, contains() for std::map etc. is mentioned to be only supported in Clang 13, but it has worked fine in our CI with Clang 12)

We can now venture more boldly into C++23 territory with these:

- Literal suffix for (signed) size_t (uz/t) https://wg21.link/P0330
- Down with ()! (relax () rules for lambdas) https://wg21.link/P1102
- if consteval https://wg21.link/P1938
- Narrowing contextual conversions to bool (in static_assert and constexpr if) https://wg21.link/P1401 - Add support for preprocessing directives #elifdef and #elifndef https://wg21.link/P2334 - Non-literal variables (and labels and gotos) in constexpr functions https://wg21.link/P2242 - Multidimensional subscript operator (operator[x, y]) https://wg21.link/P2128
- Attributes on lambdas https://wg21.link/P2173
- std::to_underlying() https://wg21.link/P1682
- Range constructor for std::basic_string_view https://wg21.link/P1989
- std::byteswap() https://wg21.link/P1272
- std::basic_string::resize_and_overwrite() https://wg21.link/P1072
- Monadic operations for std::optional (and_then(), or_else(), transform()) https://wg21.link/P0798
- std::unreachable() https://wg21.link/P0627

Ilmari

Reply via email to