Comment 0 for bug 1093504

Revision history for this message
Mark Browning (mabrowningrr) wrote :

When a container is added for a list of pointers to const objects, the generated code has compilation errors.

The generated method signature is

int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec * *address);

It needs to be:

int _wrap_convert_py2c__CReportSpec_const___star__(PyObject *value, CReportSpec const * *address);

The following script will produce this error case in the pybindgen 0.16.0 archive.

from pybindgen import Module, FileCodeSink
import sys

def main():
    out = FileCodeSink(sys.stdout)
    module = Module('acc', cpp_namespace='::')

    module.add_include('"const_test.hpp"')
    module.add_class('CReportSpec', )
    module.add_container('std::list< CReportSpec const * >', 'CReportSpec const *', container_type='list')

    module.generate(out)

if __name__ == '__main__':
    main()