Skip to content

ROOT/LLVM fails with C++20 and new GCC 14.3/15.1 #18939

@smuzaffar

Description

@smuzaffar

Check duplicate issues.

  • Checked for duplicates

Description

ROOT failed[a] to build using newer GCC 14.3.1. Searching net I found

Any idea how to fix/avoid this build error?
[a]

root-6.32.13/interpreter/llvm-project/llvm/include/llvm/ADT/iterator.h:272:16: error: static assertion failed: The '-' operator is only defined for random access iterators.
  272 |         BaseT::IsRandomAccess,
      |                ^~~~~~~~~~~~~~
root-6.32.13/interpreter/llvm-project/llvm/include/llvm/ADT/iterator.h:272:16: note: 'llvm::iterator_facade_base<llvm::StringMapKeyIterator<llvm::StringRef>, std::forward_iterator_tag, llvm::StringRef, long int, llvm::StringRef*, llvm::StringRef&>::IsRandomAccess' evaluates to false
root-6.32.13/interpreter/llvm-project/llvm/include/llvm/ADT/iterator.h:274:14: error: no match for 'operator-' (operand types are 'const llvm::StringMapConstIterator<llvm::StringRef>' and 'const llvm::StringMapConstIterator<llvm::StringRef>')
  274 |     return I - RHS.I;

Reproducer

Build ROOT 6.32 (or root master) using latest GCC 15.1 or 14.3.1 with C++20

ROOT version

ROOT 6.32

Installation method

build from sources

Operating system

Linux

Additional context

Build ROOT for CMS offline software

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions