Bug 282827

Summary: math/libdivide: fix build with clang 19
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Some People Flags: thierry: maintainer-feedback+
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 280562    
Attachments:
Description Flags
math/libdivide: fix build with clang 19 none

Description Dimitry Andric freebsd_committer freebsd_triage 2024-11-18 08:56:13 UTC
Clang 19 has become more strict about errors in member functions, which
results in errors building math/libdivide:

  /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:41: error: no member named 'denom' in 'divider<T, ALGO>'
   3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
        |                                   ~~~~~ ^
  /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:80: error: no member named 'denom' in 'divider<T, ALGO>'
   3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
        |                                                                          ~~~~~ ^

The member function `operator==()` should refer to `other.div.denom`
instead. Upstream fixed this in
https://github.com/ridiculousfish/libdivide/commit/fa020f3, so import it
as a patch.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-11-18 09:01:08 UTC
Created attachment 255254 [details]
math/libdivide: fix build with clang 19
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2024-11-18 11:13:59 UTC
Approved, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-11-18 22:52:49 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=822b0e7aebed327a924dc812b43c7cce2b19f7ea

commit 822b0e7aebed327a924dc812b43c7cce2b19f7ea
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-11-18 08:57:47 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-11-18 22:51:34 +0000

    math/libdivide: fix build with clang 19

    Clang 19 has become more strict about errors in member functions, which
    results in errors building math/libdivide:

      /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:41: error: no member named 'denom' in 'divider<T, ALGO>'
       3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
            |                                   ~~~~~ ^
      /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:80: error: no member named 'denom' in 'divider<T, ALGO>'
       3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
            |                                                                          ~~~~~ ^

    The member function `operator==()` should refer to `other.div.denom`
    instead. Upstream fixed this in
    https://github.com/ridiculousfish/libdivide/commit/fa020f3, so import it
    as a patch.

    PR:             282827
    Approved by:    thierry (maintainer)
    MFH:            2024Q4

 math/libdivide/Makefile | 3 +++
 math/libdivide/distinfo | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-11-18 22:52:49 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2216ea39e937ac6066e2ca788bd477193e05ab47

commit 2216ea39e937ac6066e2ca788bd477193e05ab47
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-11-18 08:57:47 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-11-18 22:52:33 +0000

    math/libdivide: fix build with clang 19

    Clang 19 has become more strict about errors in member functions, which
    results in errors building math/libdivide:

      /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:41: error: no member named 'denom' in 'divider<T, ALGO>'
       3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
            |                                   ~~~~~ ^
      /wrkdirs/usr/ports/math/libdivide/work/libdivide-5.0/libdivide.h:3020:80: error: no member named 'denom' in 'divider<T, ALGO>'
       3020 |         return div.denom.magic == other.denom.magic && div.denom.more == other.denom.more;
            |                                                                          ~~~~~ ^

    The member function `operator==()` should refer to `other.div.denom`
    instead. Upstream fixed this in
    https://github.com/ridiculousfish/libdivide/commit/fa020f3, so import it
    as a patch.

    PR:             282827
    Approved by:    thierry (maintainer)
    MFH:            2024Q4

    (cherry picked from commit 822b0e7aebed327a924dc812b43c7cce2b19f7ea)

 math/libdivide/Makefile | 3 +++
 math/libdivide/distinfo | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)