Bug 292110 - devel/llvm14: fix build with clang 21
Summary: devel/llvm14: fix build with clang 21
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: 292067
  Show dependency treegraph
 
Reported: 2026-01-01 20:52 UTC by Dimitry Andric
Modified: 2026-01-14 17:47 UTC (History)
0 users

See Also:
brooks: maintainer-feedback+


Attachments
devel/llvm14: fix build with clang 21 (3.09 KB, patch)
2026-01-01 20:58 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 2026-01-01 20:52:12 UTC
Recent versions of clang complain about explicit copy constructors,
leading to errors similar to:

    In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:14:
    In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:19:
    In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Object/ELFObjectFile.h:37:
    In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/ScopedPrinter.h:19:
    In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/JSON.h:49:
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/ADT/DenseMap.h:129:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      129 |       unsigned NumEntries = getNumEntries();
          |                ^
    /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:512:42: error: chosen constructor is explicit in copy-initialization
      512 |     return SpecialCaseList::createOrDie({{ClBlacklist}},
          |                                          ^~~~~~~~~~~~~
    /usr/include/c++/v1/string:1153:64: note: explicit constructor declared here
     1153 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
          |                                                                ^
    /usr/include/c++/v1/__vector/vector.h:276:91: note: passing argument to parameter '__il' here
      276 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il) {
          |                                                                                           ^

In this case, `ClBlacklist` is an instance of `cl::opt`, not a
`std::string` as expected. Use `getValue()` to get the actual
`std::string` value.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2026-01-01 20:58:06 UTC
Created attachment 266737 [details]
devel/llvm14: fix build with clang 21
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2026-01-14 13:29:15 UTC
LGTM
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-01-14 17:38:05 UTC
A commit in branch main references this bug:

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

commit a200165263c8fcb71a9e85623330c0e01bdf0883
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-01 15:28:22 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-14 17:36:44 +0000

    devel/llvm14: fix build with clang 21

    Recent versions of clang complain about explicit copy constructors,
    leading to errors similar to:

        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:14:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:19:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Object/ELFObjectFile.h:37:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/ScopedPrinter.h:19:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/JSON.h:49:
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/ADT/DenseMap.h:129:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
          129 |       unsigned NumEntries = getNumEntries();
              |                ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:512:42: error: chosen constructor is explicit in copy-initialization
          512 |     return SpecialCaseList::createOrDie({{ClBlacklist}},
              |                                          ^~~~~~~~~~~~~
        /usr/include/c++/v1/string:1153:64: note: explicit constructor declared here
         1153 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
              |                                                                ^
        /usr/include/c++/v1/__vector/vector.h:276:91: note: passing argument to parameter '__il' here
          276 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il) {
              |                                                                                           ^

    In this case, `ClBlacklist` is an instance of `cl::opt`, not a
    `std::string` as expected. Use `getValue()` to get the actual
    `std::string` value.

    PR:             292110
    Approved by:    brooks (maintainer)
    MFH:            2026Q1

 devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-01-14 17:41:15 UTC
A commit in branch 2026Q1 references this bug:

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

commit 1896983c69b9b55be907a12e2632d18b60301900
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-01 15:28:22 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-14 17:40:20 +0000

    devel/llvm14: fix build with clang 21

    Recent versions of clang complain about explicit copy constructors,
    leading to errors similar to:

        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:14:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:19:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Object/ELFObjectFile.h:37:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/ScopedPrinter.h:19:
        In file included from /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/Support/JSON.h:49:
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/include/llvm/ADT/DenseMap.h:129:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
          129 |       unsigned NumEntries = getNumEntries();
              |                ^
        /wrkdirs/usr/ports/devel/llvm14/work/llvm-project-14.0.6.src/llvm/tools/sancov/sancov.cpp:512:42: error: chosen constructor is explicit in copy-initialization
          512 |     return SpecialCaseList::createOrDie({{ClBlacklist}},
              |                                          ^~~~~~~~~~~~~
        /usr/include/c++/v1/string:1153:64: note: explicit constructor declared here
         1153 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t) {
              |                                                                ^
        /usr/include/c++/v1/__vector/vector.h:276:91: note: passing argument to parameter '__il' here
          276 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il) {
              |                                                                                           ^

    In this case, `ClBlacklist` is an instance of `cl::opt`, not a
    `std::string` as expected. Use `getValue()` to get the actual
    `std::string` value.

    PR:             292110
    Approved by:    brooks (maintainer)
    MFH:            2026Q1

    (cherry picked from commit a200165263c8fcb71a9e85623330c0e01bdf0883)

 devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)