diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2026-01-01 16:28:22 +0100 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2026-01-14 18:40:20 +0100 |
| commit | 1896983c69b9b55be907a12e2632d18b60301900 (patch) | |
| tree | 36effa52d02cb61c8b3be526da12d565653c2f53 | |
| parent | 9e9915a4ab01368007c3f0f4c2c3abb2afef7ea1 (diff) | |
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)
| -rw-r--r-- | devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp b/devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp new file mode 100644 index 000000000000..12e1cae28c3b --- /dev/null +++ b/devel/llvm14/files/patch-llvm_tools_sancov_sancov.cpp @@ -0,0 +1,11 @@ +--- llvm/tools/sancov/sancov.cpp.orig 2021-06-28 16:23:38 UTC ++++ llvm/tools/sancov/sancov.cpp +@@ -509,7 +509,7 @@ class Blacklists { (private) + if (ClBlacklist.empty()) + return std::unique_ptr<SpecialCaseList>(); + +- return SpecialCaseList::createOrDie({{ClBlacklist}}, ++ return SpecialCaseList::createOrDie({{ClBlacklist.getValue()}}, + *vfs::getRealFileSystem()); + } + std::unique_ptr<SpecialCaseList> DefaultBlacklist; |
