Skip to content

Respect access specifier of using statements in wrapping

The VTK wrapping tools consider all 'using' statements to be inside a public access specifier. This causes errors when a subclass uses 'using' to unhide an overridden function in its parent class when that function is not public.

This commit fixes the issue by respecting the access specifier of 'using' statements.

This fixes errors when wrapping similar to the following (from Slicer):

VTKv8/Filters/Hybrid/vtkGridTransform.h: In function ‘PyObject* PyvtkOrientedGridTransform_ForwardTransformPoint(PyObject*, PyObject*)’:
VTKv8/Filters/Hybrid/vtkGridTransform.h:127:8: error: ‘virtual void vtkGridTransform::ForwardTransformPoint(const float*, float*)’ is protected
   void ForwardTransformPoint(const float in[3], float out[3]) VTK_OVERRIDE;
        ^
Libs/vtkAddon/vtkOrientedGridTransformPython.cxx:232:45: error: within this context
       op->ForwardTransformPoint(temp0, temp1);

In this particular case, the 'using' statement and the function that it unhides are inside protected access specifiers: https://github.com/Slicer/Slicer/blob/c291be0/Libs/vtkAddon/vtkOrientedGridTransform.h#L57

Merge request reports