Bug 280776 - devel/llvm14: fix build with clang 19
Summary: devel/llvm14: fix build 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: Brooks Davis
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-08-12 14:10 UTC by Dimitry Andric
Modified: 2024-08-16 15:50 UTC (History)
0 users

See Also:
brooks: maintainer-feedback+


Attachments
devel/llvm14: fix build with clang 19 (6.67 KB, patch)
2024-08-12 14:11 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-08-12 14:10:16 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/devel/llvm14/work/llvm-project-14.0.6.src/flang/include/flang/Evaluate/integer.h:310:32: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
      310 |       auto back{FROM::template ConvertSigned(result.value)};
          |                                ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:72:22: warning: variable 'z' set but not used [-Wunused-but-set-variable]
       72 |     } else if (auto *z{UnwrapExpr<Expr<SomeComplex>>(args[0])}) {
          |                      ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:69:15: warning: variable 'x' set but not used [-Wunused-but-set-variable]
       69 |     if (auto *x{UnwrapExpr<Expr<SomeReal>>(args[0])}) {
          |               ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:148:60: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
      148 |                                                            SCALE(y)};
          |                                                            ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:89:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
       89 |   accumulator.template GetResult(&result);
          |                        ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:130:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
      130 |   accumulator.template GetResult(result, zeroBasedDim);
          |                        ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:158:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
      158 |   accumulator.template GetResult(result, zeroBasedDim);
          |                        ^
    /wrkdirs/usr/ports/devel/llvm14/work/grpc-1.62.2/src/core/lib/promise/detail/basic_seq.h:103:38: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
      103 |                     Traits::template CallSeqFactory(f_, *cur_, std::move(arg)));
          |                                      ^

Upstream has committed a fix to their main branch [2], but it does not
apply cleanly to 14.0.6, so add a backported patch.

[1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96
[2] https://github.com/llvm/llvm-project/commit/7bc7672925f8154be3b8220365d3f269ac43621c
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-08-12 14:11:19 UTC
Created attachment 252710 [details]
devel/llvm14: fix build with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-08-16 15:40:18 UTC
A commit in branch main references this bug:

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

commit 51c043a810db5af08a918fd7bfc31086ead88265
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-12 13:43:49 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-16 15:34:42 +0000

    devel/llvm14: 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/devel/llvm14/work/llvm-project-14.0.6.src/flang/include/flang/Evaluate/integer.h:310:32: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          310 |       auto back{FROM::template ConvertSigned(result.value)};
              |                                ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:72:22: warning: variable 'z' set but not used [-Wunused-but-set-variable]
           72 |     } else if (auto *z{UnwrapExpr<Expr<SomeComplex>>(args[0])}) {
              |                      ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:69:15: warning: variable 'x' set but not used [-Wunused-but-set-variable]
           69 |     if (auto *x{UnwrapExpr<Expr<SomeReal>>(args[0])}) {
              |               ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:148:60: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          148 |                                                            SCALE(y)};
              |                                                            ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:89:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
           89 |   accumulator.template GetResult(&result);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:130:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          130 |   accumulator.template GetResult(result, zeroBasedDim);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:158:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          158 |   accumulator.template GetResult(result, zeroBasedDim);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/grpc-1.62.2/src/core/lib/promise/detail/basic_seq.h:103:38: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          103 |                     Traits::template CallSeqFactory(f_, *cur_, std::move(arg)));
              |                                      ^

    Upstream has committed a fix to their main branch [2], but it does not
    apply cleanly to 14.0.6, so add a backported patch.

    [1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96
    [2] https://github.com/llvm/llvm-project/commit/7bc7672925f8154be3b8220365d3f269ac43621c

    PR:             280776
    Approved by:    brooks (maintainer)
    MFH:            2024Q3

 devel/llvm14/files/patch-backport-7bc7672925 (new) | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-16 15:45:25 UTC
A commit in branch 2024Q3 references this bug:

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

commit 1efe047448b0922f2057dd2fc382f9b498f8a098
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-12 13:43:49 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-16 15:44:13 +0000

    devel/llvm14: 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/devel/llvm14/work/llvm-project-14.0.6.src/flang/include/flang/Evaluate/integer.h:310:32: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          310 |       auto back{FROM::template ConvertSigned(result.value)};
              |                                ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:72:22: warning: variable 'z' set but not used [-Wunused-but-set-variable]
           72 |     } else if (auto *z{UnwrapExpr<Expr<SomeComplex>>(args[0])}) {
              |                      ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:69:15: warning: variable 'x' set but not used [-Wunused-but-set-variable]
           69 |     if (auto *x{UnwrapExpr<Expr<SomeReal>>(args[0])}) {
              |               ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/lib/Evaluate/fold-real.cpp:148:60: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          148 |                                                            SCALE(y)};
              |                                                            ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:89:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
           89 |   accumulator.template GetResult(&result);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:130:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          130 |   accumulator.template GetResult(result, zeroBasedDim);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/flang/runtime/reduction-templates.h:158:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          158 |   accumulator.template GetResult(result, zeroBasedDim);
              |                        ^
        /wrkdirs/usr/ports/devel/llvm14/work/grpc-1.62.2/src/core/lib/promise/detail/basic_seq.h:103:38: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
          103 |                     Traits::template CallSeqFactory(f_, *cur_, std::move(arg)));
              |                                      ^

    Upstream has committed a fix to their main branch [2], but it does not
    apply cleanly to 14.0.6, so add a backported patch.

    [1] https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96
    [2] https://github.com/llvm/llvm-project/commit/7bc7672925f8154be3b8220365d3f269ac43621c

    PR:             280776
    Approved by:    brooks (maintainer)
    MFH:            2024Q3

    (cherry picked from commit 51c043a810db5af08a918fd7bfc31086ead88265)

 devel/llvm14/files/patch-backport-7bc7672925 (new) | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)