From f2c87504c4c3517a8420d789e40411f74fe45e19 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 7 Apr 2026 11:46:07 +0200 Subject: hashes: Use std::span instead of std::basic_string_view std::basic_string_view should not be initialized locally, only in the std library. Replace it with a simple span instead. This should fix compilation with LLVM 18+. Supersedes: https://salsa.debian.org/apt-team/apt/-/merge_requests/511 --- apt-pkg/contrib/hashes.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 9c0ce40d2..74419b63b 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -296,7 +296,7 @@ bool HashStringList::operator!=(HashStringList const &other) const return !(*this == other); } /*}}}*/ -static APT_PURE std::string HexDigest(std::basic_string_view const &Sum) +static APT_PURE std::string HexDigest(std::span const &Sum) { char Conv[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', @@ -360,7 +360,7 @@ class PrivateHashes EVP_DigestFinal_ex(tmpContext, Sum, nullptr); EVP_MD_CTX_destroy(tmpContext); - return ::HexDigest(std::basic_string_view(Sum, Size)); + return ::HexDigest(std::span(Sum, Size)); } bool Enable(HashAlgo const &algo) -- cgit v1.2.3-70-g09d2