Skip to content

[Python] Calling std::span::begin() broken with gcc15 #18837

Open
@VanyaBelyaev

Description

@VanyaBelyaev

Check duplicate issues.

  • Checked for duplicates

Description

In my project I using RooAbsData::RealSpans and further move the contets into numpy.
I've observed that dev3 slot of LCG nightly builds added gcc15.
I'am very happy to tets my project isng gcc15.
Howevet it breaks with complains for std::span (I tlooks like numpy has problmem to assign from std::span. The message is
"""
input_line_72:7:113: error: '__iter_tag' is a private member of 'std::span<const double, 18446744073709551615ull>'
new (ret) (__gnu_cxx::__normal_iterator<const double , std::span<const double, 18446744073709551615ull>::__iter_tag>) (((const std::span<const double, 18446744073709551615ull>)obj)->begin());
^
/cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/15.1.0/../../../../include/c++/15.1.0/span:149:14: note: implicitly declared private here
struct __iter_tag;
^
"""

Reproducer

The reproducer is relatively easy and attchched as a file (just rename .txt to .py) (likely it coudl be further simplified)

tst_850.txt

Here the output for gcc13 (OK) , gcc14 (OK) and gcc15 is shown:

"""
ibelyaev@lxplus944:ibelyaev$
ibelyaev@lxplus944:ibelyaev$ ( source /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-el9-gcc13-opt/setup.sh ; python tst_850.py )
x <class cppyy.gbl.span<const double,18446744073709551615ull> at 0x89f0610> 100 [1.4034845362312425, -0.28628869417532565, -1.0114234868398946, -0.054642168731246506, -0.34123430204162625]
y <class cppyy.gbl.span<const double,18446744073709551615ull> at 0x89f0610> 100 [1.1069688922378622, -0.5902901135885832, -2.161389389911874, -0.8607709424256781, -1.738313369899618]
ibelyaev@lxplus944:ibelyaev$ ( source /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-el9-gcc14-opt/setup.sh ; python tst_850.py )
x <class cppyy.gbl.span<const double,18446744073709551615ull> at 0x986eaa0> 100 [-1.701284098076202, -0.333201425461534, 1.908921311110239, -1.0736069409294278, 0.21344475554997497]
y <class cppyy.gbl.span<const double,18446744073709551615ull> at 0x986eaa0> 100 [-0.28400189792921837, 0.08186970608767544, -1.4120969213056767, 1.0836536576601317, 0.1318393678249895]
ibelyaev@lxplus944:ibelyaev$ ( source /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-el9-gcc15-opt/setup.sh ; python tst_850.py )
input_line_72:7:113: error: '__iter_tag' is a private member of 'std::span<const double, 18446744073709551615ull>'
new (ret) (__gnu_cxx::__normal_iterator<const double , std::span<const double, 18446744073709551615ull>::__iter_tag>) (((const std::span<const double, 18446744073709551615ull>)obj)->begin());
^
/cvmfs/sft.cern.ch/lcg/releases/gcc/15.1.0-5b2b0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/15.1.0/../../../../include/c++/15.1.0/span:149:14: note: implicitly declared private here
struct __iter_tag;
^
Traceback (most recent call last):
File "/tmp/ibelyaev/tst_850.py", line 29, in
part [ name ] = data
~~~~~^^^^^^^^^
ValueError: nullptr result where temporary expected
ibelyaev@lxplus944:ibelyaev$

"""

ROOT version

ROOT 6.37/1 from LCG dev3 cvmfs nighlies build

Installation method

LCG nighlies cvmfs build dev3 slot

Operating system

Linux

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions