Skip to content

Strange wrapper code generated in cppyy unit test for cmake_cxxmodules=OFF with C++17 #21005

@guitargeek

Description

@guitargeek

One of the cppyy unit tests...

    def test49_addressof_method(self):
        """Use of addressof for (const) methods"""

        import cppyy

        assert cppyy.addressof(cppyy.gbl.std.vector[int].at.__overload__(':any:', False))
        assert cppyy.addressof(cppyy.gbl.std.vector[int].at.__overload__(':any:', True))

...fails with this error only on alma9 with cmake_cxxmodules=OFF and `CMAKE_CXX_STANDARD=17``:

=================================== FAILURES ===================================
____________________ TestDATATYPES.test49_addressof_method _____________________

self = <test.test_datatypes.TestDATATYPES object at 0x7fb5a77f3200>

    @mark.xfail(strict=True, condition=IS_MAC_ARM or IS_WINDOWS, reason="Crashes on mac-beta ARM64 and fails on Windows")
    def test49_addressof_method(self):
        """Use of addressof for (const) methods"""

        import cppyy

>       assert cppyy.addressof(cppyy.gbl.std.vector[int].at.__overload__(':any:', False))
E       AssertionError: assert 0
E        +  where 0 = <built-in function addressof>(<cppyy.CPPOverload object at 0x7fb5a7a62000>)
E        +    where <built-in function addressof> = <module 'cppyy' from '/github/home/ROOT-CI/build/lib/cppyy/__init__.py'>.addressof
E        +    and   <cppyy.CPPOverload object at 0x7fb5a7a62000> = <built-in method __overload__ of cppyy.CPPOverload object at 0x7fb5a7aaaa00>(':any:', False)
E        +      where <built-in method __overload__ of cppyy.CPPOverload object at 0x7fb5a7aaaa00> = <cppyy.CPPOverload object at 0x7fb5a7aaaa00>.__overload__
E        +        where <cppyy.CPPOverload object at 0x7fb5a7aaaa00> = <class cppyy.gbl.std.vector<int> at 0x5628463dfb40>.at

../../../../../../src/bindings/pyroot/cppyy/cppyy/test/test_datatypes.py:2348: AssertionError
----------------------------- Captured stderr call -----------------------------
input_line_412:2:106: error: 'RActivePhysicalColumns' is a protected member of 'ROOT::Internal::RPageSource'
 (vector<int>::reference (std::vector<int, std::allocator<int> >::*)(vector<ROOT::Internal::RPageSource::RActivePhysicalColumns::RColumnInfo>::size_type))&std::vector<int, std::allocator<int> >::at
                                                                                                         ^
/github/home/ROOT-CI/build/include/ROOT/RPageStorage.hxx:653:10: note: declared protected here
   class RActivePhysicalColumns {
         ^
=========================== short test summary info ============================

It's strange that the generated wrapper code that is generated (by TClingCallFunc?) and gives a compiler error uses unrelated ROOT classes, like ROOT::Internal::RPageSource. So even though this is a niche problem, it might hint to some more fundamental problem in Cling.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions