Bug 282949

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

Description Dimitry Andric freebsd_committer freebsd_triage 2024-11-24 16:51:54 UTC
Clang 19 now implements CWG 96 [1], which requires a template argument
list after a 'template' keyword, resulting in errors similar to:

  /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:241:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    241 |     index_ = value_.template Construct(std::forward<Args>(args)...);
        |                              ^
  /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:258:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    258 |     if (!value_.template Assign(TypeTag<T>{}, index_, std::forward<U>(value))) {
        |                          ^
  /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:265:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    265 |     if (!value_.template Assign(index_, std::forward<T>(value))) {
        |                          ^

In all these cases, appending "<>" is enough to satisfy the constraint.

[1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-11-24 16:53:01 UTC
Created attachment 255427 [details]
math/dgl: fix build with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-12-13 23:31:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4dc6727cb525f1252c5483cf80a691fd5bbeb49d

commit 4dc6727cb525f1252c5483cf80a691fd5bbeb49d
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-11-24 16:52:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-13 23:26:16 +0000

    math/dgl: fix build with clang 19

    Clang 19 now implements CWG 96 [1], which requires a template argument
    list after a 'template' keyword, resulting in errors similar to:

      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:241:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        241 |     index_ = value_.template Construct(std::forward<Args>(args)...);
            |                              ^
      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:258:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        258 |     if (!value_.template Assign(TypeTag<T>{}, index_, std::forward<U>(value))) {
            |                          ^
      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:265:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        265 |     if (!value_.template Assign(index_, std::forward<T>(value))) {
            |                          ^

    In all these cases, appending "<>" is enough to satisfy the constraint.

    [1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96

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

 ..._party_libnop_include_nop_types_variant.h (new) | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-12-13 23:32:34 UTC
A commit in branch 2024Q4 references this bug:

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

commit feb735b259f489db5e4f3f6704b057cf634dd3f4
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-11-24 16:52:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-13 23:31:56 +0000

    math/dgl: fix build with clang 19

    Clang 19 now implements CWG 96 [1], which requires a template argument
    list after a 'template' keyword, resulting in errors similar to:

      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:241:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        241 |     index_ = value_.template Construct(std::forward<Args>(args)...);
            |                              ^
      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:258:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        258 |     if (!value_.template Assign(TypeTag<T>{}, index_, std::forward<U>(value))) {
            |                          ^
      /wrkdirs/usr/ports/math/dgl/work/dgl-1.1.2/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:265:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
        265 |     if (!value_.template Assign(index_, std::forward<T>(value))) {
            |                          ^

    In all these cases, appending "<>" is enough to satisfy the constraint.

    [1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96

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

    (cherry picked from commit 4dc6727cb525f1252c5483cf80a691fd5bbeb49d)

 ..._party_libnop_include_nop_types_variant.h (new) | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)