Bug 281880 - math/cgal: fix headers for use with clang 19
Summary: math/cgal: fix headers for use with clang 19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Wen Heping
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-10-05 22:58 UTC by Dimitry Andric
Modified: 2024-10-20 10:00 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (wen)


Attachments
math/cgal: fix headers for use with clang 19 (5.05 KB, patch)
2024-10-05 22:59 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-10-05 22:58:58 UTC
Clang 19 has become more strict about errors in member functions, which
results in errors building ports that use headers from math/cgal, such
as cad/csxcad:

  In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron.cpp:25:
  In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron_p.h:6:
  In file included from /usr/local/include/CGAL/Polyhedron_3.h:25:
  In file included from /usr/local/include/CGAL/HalfedgeDS_default.h:23:
  In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h:15:
  In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS.h:29:
  /usr/local/include/CGAL/boost/graph/iterator.h:224:22: error: no member named 'base' in 'Halfedge_around_source_iterator<Graph>'
    224 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^
  /usr/local/include/CGAL/boost/graph/iterator.h:324:22: error: no member named 'base' in 'Halfedge_around_target_iterator<Graph>'
    324 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^
  /usr/local/include/CGAL/boost/graph/iterator.h:423:22: error: no member named 'base' in 'Halfedge_around_face_iterator<Graph>'
    423 |     return (! (this->base() == nullptr)) ?
        |                ~~~~  ^

The problem is that the `base()` member function is only available when
an iterator is derived from `boost::iterator_adaptor`, but the three
iterators mentioned above, `Halfedge_around_source_iterator`,
`Halfedge_around_target_iterator` and `Halfedge_around_face_iterator`
are not.

Upstream CGAL has done a bit more refactoring in this particular area,
but is enough to cherry-pick the changes that remove the `operator
bool_type() const` member functions, which reference the non-existing
`base()` member function.

Bump PORTREVISION to ensure dependent ports build against the fixed
headers.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-10-05 22:59:50 UTC
Created attachment 254030 [details]
math/cgal: fix headers for use with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-20 09:58:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=54b05f1c1eb7a7d7d8ffa823c19babe8dae9fc66

commit 54b05f1c1eb7a7d7d8ffa823c19babe8dae9fc66
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-05 22:59:13 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-20 09:57:11 +0000

    math/cgal: fix headers for use with clang 19

    Clang 19 has become more strict about errors in member functions, which
    results in errors building ports that use headers from math/cgal, such
    as cad/csxcad:

      In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron.cpp:25:
      In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron_p.h:6:
      In file included from /usr/local/include/CGAL/Polyhedron_3.h:25:
      In file included from /usr/local/include/CGAL/HalfedgeDS_default.h:23:
      In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h:15:
      In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS.h:29:
      /usr/local/include/CGAL/boost/graph/iterator.h:224:22: error: no member named 'base' in 'Halfedge_around_source_iterator<Graph>'
        224 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^
      /usr/local/include/CGAL/boost/graph/iterator.h:324:22: error: no member named 'base' in 'Halfedge_around_target_iterator<Graph>'
        324 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^
      /usr/local/include/CGAL/boost/graph/iterator.h:423:22: error: no member named 'base' in 'Halfedge_around_face_iterator<Graph>'
        423 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^

    The problem is that the `base()` member function is only available when
    an iterator is derived from `boost::iterator_adaptor`, but the three
    iterators mentioned above, `Halfedge_around_source_iterator`,
    `Halfedge_around_target_iterator` and `Halfedge_around_face_iterator`
    are not.

    Upstream CGAL has done a bit more refactoring in this particular area,
    but is enough to cherry-pick the changes that remove the `operator
    bool_type() const` member functions, which reference the non-existing
    `base()` member function.

    Bump PORTREVISION to ensure dependent ports build against the fixed
    headers.

    PR:             281880
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

 math/cgal/Makefile                                 |  2 +-
 ...patch-include_CGAL_boost_graph_iterator.h (new) | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-10-20 09:58:35 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5f8037e8c926def9d6e9d13f4038502f6ea82c30

commit 5f8037e8c926def9d6e9d13f4038502f6ea82c30
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-05 22:59:13 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-20 09:58:05 +0000

    math/cgal: fix headers for use with clang 19

    Clang 19 has become more strict about errors in member functions, which
    results in errors building ports that use headers from math/cgal, such
    as cad/csxcad:

      In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron.cpp:25:
      In file included from /wrkdirs/usr/ports/cad/csxcad/work/CSXCAD-0.6.3/src/CSPrimPolyhedron_p.h:6:
      In file included from /usr/local/include/CGAL/Polyhedron_3.h:25:
      In file included from /usr/local/include/CGAL/HalfedgeDS_default.h:23:
      In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS_default.h:15:
      In file included from /usr/local/include/CGAL/boost/graph/graph_traits_HalfedgeDS.h:29:
      /usr/local/include/CGAL/boost/graph/iterator.h:224:22: error: no member named 'base' in 'Halfedge_around_source_iterator<Graph>'
        224 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^
      /usr/local/include/CGAL/boost/graph/iterator.h:324:22: error: no member named 'base' in 'Halfedge_around_target_iterator<Graph>'
        324 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^
      /usr/local/include/CGAL/boost/graph/iterator.h:423:22: error: no member named 'base' in 'Halfedge_around_face_iterator<Graph>'
        423 |     return (! (this->base() == nullptr)) ?
            |                ~~~~  ^

    The problem is that the `base()` member function is only available when
    an iterator is derived from `boost::iterator_adaptor`, but the three
    iterators mentioned above, `Halfedge_around_source_iterator`,
    `Halfedge_around_target_iterator` and `Halfedge_around_face_iterator`
    are not.

    Upstream CGAL has done a bit more refactoring in this particular area,
    but is enough to cherry-pick the changes that remove the `operator
    bool_type() const` member functions, which reference the non-existing
    `base()` member function.

    Bump PORTREVISION to ensure dependent ports build against the fixed
    headers.

    PR:             281880
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

    (cherry picked from commit 54b05f1c1eb7a7d7d8ffa823c19babe8dae9fc66)

 math/cgal/Makefile                                 |  2 +-
 ...patch-include_CGAL_boost_graph_iterator.h (new) | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)