ROOT v6.28.06 build failure on macOS 14 / XCode 15 and C++20

When trying to build ROOT with C++20 on macOS 14 using AppleClang 15, I get a number of build failures, first from LLVM (I think), and then I think from a few ROOT compilation units:

[ 79%] Generating G__Core.cxx, ../lib/Core.pcm
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:581:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/ranges:355:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__ranges/elements_view.h:155:38: error: cannot take address of consteval function '__get_iterator_category' outside of an immediate invocation
  using iterator_category = decltype(__get_iterator_category());
                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__ranges/elements_view.h:142:25: note: declared here
  static consteval auto __get_iterator_category() {
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__ranges/elements_view.h:197:37: error: cannot take address of consteval function '__get_iterator_concept' outside of an immediate invocation
  using iterator_concept = decltype(__get_iterator_concept());
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__ranges/elements_view.h:184:25: note: declared here
  static consteval auto __get_iterator_concept() {
                        ^
input_line_1:1:10: fatal error: could not build module 'std'
#include <new>
 ~~~~~~~~^
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
Warning in cling::IncrementalParser::CheckABICompatibility():
  Possible C++ standard library mismatch, compiled with _LIBCPP_ABI_VERSION '1'
  Extraction of runtime standard library version was: ''
While building module 'Core':
While building module 'Cling_Runtime' imported from input_line_2:1:
While building module 'Cling_Runtime_Extra' imported from /Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:
In file included from <module-includes>:1:
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
#include <string>
 ~~~~~~~~^
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
#include "cling/Interpreter/Visibility.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Rtypes' imported from /Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/Rtypes.h:23:
In file included from <module-includes>:1:
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/RtypesCore.h:28:10: fatal error: could not build module 'std'
#include <cstddef> // size_t, NULL
 ~~~~~~~~^
In file included from input_line_3:2:
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/Rtypes.h:23:10: fatal error: could not build module 'ROOT_Rtypes'
#include "RtypesCore.h"
 ~~~~~~~~^~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Foundation_C' imported from /Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/Rtypes.h:29:
In file included from <module-includes>:1:
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/ThreadLocalStorage.h:60:10: fatal error: could not build module 'ROOT_Rtypes'
#include "RtypesCore.h"
 ~~~~~~~~^~~~~~~~~~~~~~
While building module 'Core':
While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/Rtypes.h:197:
In file included from <module-includes>:2:
/Users/pagessin/dev/ci-dependencies/build_all_cpp20_15p0/root/src/root-build/include/ROOT/RStringView.hxx:25:10: fatal error: could not build module 'std'
#include <string_view>
 ~~~~~~~~^
Error: Error loading the default rootcling header files.
make[6]: *** [core/G__Core.cxx] Error 1
make[5]: *** [core/CMakeFiles/G__Core.dir/all] Error 2
make[5]: *** Waiting for unfinished jobs....

When switching to C++17, the build completes successfully.


ROOT Version: 6.28.06
Platform: macOS 14
Compiler: AppleClang 15


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.