Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2024 23:31:17 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 4dc6727cb525 - main - math/dgl: fix build with clang 19
Message-ID:  <202412132331.4BDNVHB3079100@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

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
---
 ...third__party_libnop_include_nop_types_variant.h | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/math/dgl/files/patch-third__party_tensorpipe_third__party_libnop_include_nop_types_variant.h b/math/dgl/files/patch-third__party_tensorpipe_third__party_libnop_include_nop_types_variant.h
new file mode 100644
index 000000000000..004e29c616b6
--- /dev/null
+++ b/math/dgl/files/patch-third__party_tensorpipe_third__party_libnop_include_nop_types_variant.h
@@ -0,0 +1,28 @@
+--- third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h.orig	2020-07-24 02:13:02 UTC
++++ third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h
+@@ -238,7 +238,7 @@ class Variant {
+   // resulting type.
+   template <typename... Args>
+   void Construct(Args&&... args) {
+-    index_ = value_.template Construct(std::forward<Args>(args)...);
++    index_ = value_.template Construct<>(std::forward<Args>(args)...);
+   }
+   void Construct(EmptyVariant) {}
+ 
+@@ -255,14 +255,14 @@ class Variant {
+   // multiple element types.
+   template <typename T, typename U>
+   void Assign(TypeTag<T>, U&& value) {
+-    if (!value_.template Assign(TypeTag<T>{}, index_, std::forward<U>(value))) {
++    if (!value_.template Assign<>(TypeTag<T>{}, index_, std::forward<U>(value))) {
+       Destruct();
+       Construct(TypeTag<T>{}, std::forward<U>(value));
+     }
+   }
+   template <typename T>
+   void Assign(T&& value) {
+-    if (!value_.template Assign(index_, std::forward<T>(value))) {
++    if (!value_.template Assign<>(index_, std::forward<T>(value))) {
+       Destruct();
+       Construct(std::forward<T>(value));
+     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412132331.4BDNVHB3079100>