summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-01-01 17:46:27 +0100
committerDimitry Andric <dim@FreeBSD.org>2026-01-14 18:40:29 +0100
commit7a0510a4f44a8198c6997e25dd3942c8b7774460 (patch)
tree0da8eaa8c53c992dc328afbf9e7509b8d33b6c36
parent1896983c69b9b55be907a12e2632d18b60301900 (diff)
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)
-rw-r--r--devel/llvm15/files/patch-llvm_tools_sancov_sancov.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/devel/llvm15/files/patch-llvm_tools_sancov_sancov.cpp b/devel/llvm15/files/patch-llvm_tools_sancov_sancov.cpp
new file mode 100644
index 000000000000..3d5271dc4f55
--- /dev/null
+++ b/devel/llvm15/files/patch-llvm_tools_sancov_sancov.cpp
@@ -0,0 +1,15 @@
+--- llvm/tools/sancov/sancov.cpp.orig 2023-01-12 07:12:30 UTC
++++ llvm/tools/sancov/sancov.cpp
+@@ -529,10 +529,10 @@ class Ignorelists { (private)
+ return std::unique_ptr<SpecialCaseList>();
+
+ if (!ClBlacklist.empty())
+- return SpecialCaseList::createOrDie({{ClBlacklist}},
++ return SpecialCaseList::createOrDie({{ClBlacklist.getValue()}},
+ *vfs::getRealFileSystem());
+
+- return SpecialCaseList::createOrDie({{ClIgnorelist}},
++ return SpecialCaseList::createOrDie({{ClIgnorelist.getValue()}},
+ *vfs::getRealFileSystem());
+ }
+ std::unique_ptr<SpecialCaseList> DefaultIgnorelist;