Skip to content

Compilation errors with gcc 15.1 and C++23 in ScalarTransformer.h

Hi @clemenci,

When building Gaudi (master) with gcc-15.1.0 and C++23, we are seeing multiple build errors related to the use of std::apply in Gaudi::Functional::ScalarTransformer.

The errors look like this:

GaudiFunctional/include/Gaudi/Functional/ScalarTransformer.h:39:23: error: no matching function for call to 'apply(Gaudi::Functional::ScalarTransformer<Gaudi::Examples::OptLdExpTransformer, std::vector<double>(const std::vector<double>&, const std::vector<int>&), Gaudi::Functional::Traits::BaseClass_t<Gaudi::Algorithm> >::operator()(const std::vector<double>&, const std::vector<int>&) const::<lambda(const auto:119& ...)>, const ranges::common_pair<const double&, const int&>&)'
   39 |             std::apply( [&]( const auto&... i ) { return scalar( details::deref( i )... ); }, tuple ) );
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/jenkins/workspace/lcg_nightly_pipeline/build/frameworks/Gaudi-master/src/Gaudi/master/GaudiFunctional/include/Gaudi/Functional/ScalarTransformer.h:39:23: note: there is 1 candidate
In file included from /cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/bits/uses_allocator_args.h:41,
                 from /cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/bits/memory_resource.h:43,
                 from /cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/deque:85,
                 from /build/jenkins/workspace/lcg_nightly_pipeline/build/frameworks/Gaudi-master/src/Gaudi/master/GaudiKernel/include/Gaudi/MonitoringHub.h:15:
/cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/tuple:2930:5: note: candidate 1: 'template<class _Fn, class _Tuple>  requires  __tuple_like<_Tuple> constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&)'
 2930 |     apply(_Fn&& __f, _Tuple&& __t)
      |     ^~~~~
/cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/tuple:2930:5: note: template argument deduction/substitution failed:
/cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/include/c++/15.1.0/tuple:2930:5: note: constraints not satisfied

This happens in GaudiFunctional/include/Gaudi/Functional/ScalarTransformer.h: line 39 and 81

The full build log attached - Gaudi-master-build.log

Edited by Dmitri Konstantinov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information