Recent versions of clang complain about explicit copy constructors, leading to errors similar to: /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:532:44: error: chosen constructor is explicit in copy-initialization 532 | 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) { | ^ /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:535:42: error: chosen constructor is explicit in copy-initialization 535 | return SpecialCaseList::createOrDie({{ClIgnorelist}}, | ^~~~~~~~~~~~~~ /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` and `ClIgnoreList` are instances of `cl::opt`, not a `std::string` as expected. Use `getValue()` to get the actual `std::string` values.
Created attachment 266738 [details] devel/llvm15: fix build with clang 21
LGTM
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e77e39dc86cae4b1228be3f45c4ec2b1bfaede09 commit e77e39dc86cae4b1228be3f45c4ec2b1bfaede09 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-01-01 16:46:27 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-01-14 17:36:44 +0000 devel/llvm15: fix build with clang 21 Recent versions of clang complain about explicit copy constructors, leading to errors similar to: /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:532:44: error: chosen constructor is explicit in copy-initialization 532 | 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) { | ^ /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:535:42: error: chosen constructor is explicit in copy-initialization 535 | return SpecialCaseList::createOrDie({{ClIgnorelist}}, | ^~~~~~~~~~~~~~ /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` and `ClIgnoreList` are instances of `cl::opt`, not a `std::string` as expected. Use `getValue()` to get the actual `std::string` values. PR: 292111 Approved by: brooks (maintainer) MFH: 2026Q1 .../llvm15/files/patch-llvm_tools_sancov_sancov.cpp (new) | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
A commit in branch 2026Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7a0510a4f44a8198c6997e25dd3942c8b7774460 commit 7a0510a4f44a8198c6997e25dd3942c8b7774460 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2026-01-01 16:46:27 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2026-01-14 17:40:29 +0000 devel/llvm15: fix build with clang 21 Recent versions of clang complain about explicit copy constructors, leading to errors similar to: /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:532:44: error: chosen constructor is explicit in copy-initialization 532 | 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) { | ^ /wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:535:42: error: chosen constructor is explicit in copy-initialization 535 | return SpecialCaseList::createOrDie({{ClIgnorelist}}, | ^~~~~~~~~~~~~~ /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` and `ClIgnoreList` are instances of `cl::opt`, not a `std::string` as expected. Use `getValue()` to get the actual `std::string` values. PR: 292111 Approved by: brooks (maintainer) MFH: 2026Q1 (cherry picked from commit e77e39dc86cae4b1228be3f45c4ec2b1bfaede09) .../llvm15/files/patch-llvm_tools_sancov_sancov.cpp (new) | 15 +++++++++++++++ 1 file changed, 15 insertions(+)