Skip to content

Handle deprecation of top-level comma expression in array subscripts -Wdeprecated-comma-subscript #2837

@ManifoldFR

Description

@ManifoldFR

Support for things like arr[expr1, expr2] has been deprecated in the C++20 standard and is unsupported from C++23.

Indeed this warning crops up on Clang 20:

/home/XYZ/pinocchio/include/pinocchio/bindings/python/collision/broadphase-manager.hpp:35:91: warning: top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23 [-Wdeprecated-comma-subscript]
   33 |           .def(bp::init<const Model *, const GeometryModel *, GeometryData *>(
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   34 |             bp::args("self", "model", "geometry_model", "geometry_data"), "Default constructor")
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   35 |                  [bp::with_custodian_and_ward<1, 2>(), bp::with_custodian_and_ward<1, 3>(),
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   36 |                   bp::with_custodian_and_ward<1, 4>()])

It seems this mostly concerns the Python bindings when there is some complex lifetime stuff going on.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions