Building root with standard set to C++20 results in compilation errors on Linux

Ah, alright, thank you for the extra details.

  • ROOT v6.28.06 did not support C++20. You should try with latest master or at least with v6.28.10
  • gcc 9 does not have good C++20 support (see here). I think you will need at least gcc 10, which added std::span and the three-way comparison operator. But 12 or 13 would be better.

As a test I’m building latest master with gcc 13.2.1 passing the following cmake commands:

mkdir cmake-build && \
cmake -S . -B cmake-build -G Ninja -DCMAKE_INSTALL_PREFIX=cmake-build/install -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -Dtesting=ON -Droottest=OFF && \
cmake --build cmake-build -- -j16 install

So far no errors, I’ll report here when done.

Cheers,
Enrico