Skip to content

SMESH fails to build with GCC 12 #57

Description

@hobbes1069

Fedora Rawhide has updated to gcc 12 and several packages are failing to build including SMESH which has the following error:

/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx: In member function 'void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*, const std::vector<std::_Rb_tree_iterator<std::pair<const SMDS_MeshNode* const, std::__cxx11::list<const SMDS_MeshNode*> > > >&, std::__cxx11::list<const SMDS_MeshElement*>&, size_t, SMESH_SequenceOfElemPtr&)':
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:18: error: no matching function for call to 'swap(std::vector<bool>::reference, std::vector<bool>::reference)'
 4310 |         std::swap( isSingleNode[0], isSingleNode[1] );
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/bits/exception_ptr.h:43,
                 from /usr/include/c++/12/exception:168,
                 from /usr/include/boost/smart_ptr/bad_weak_ptr.hpp:21,
                 from /usr/include/boost/smart_ptr/detail/shared_count.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESHDS/SMESH_Controls.hxx:32,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.hxx:33,
                 from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:27:
/usr/include/c++/12/bits/move.h:196:5: note: candidate: 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = _Bit_reference; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' (near match)
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/12/bits/move.h:196:5: note:   conversion of argument 2 would be ill-formed:
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:51: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::vector<bool>::reference'
 4310 |         std::swap( isSingleNode[0], isSingleNode[1] );
      |                                     ~~~~~~~~~~~~~~^
/usr/include/c++/12/bits/move.h:220:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions