srctree

Robin Linden parent 80ec6c2f 322d8283
meta/clang-tidy: Enable cppcoreguidelines-owning-memory

inlinesplit
.clang-tidy added: 4, removed: 6, total 0
@@ -68,7 +68,6 @@ Checks: >
-cppcoreguidelines-init-variables,
-cppcoreguidelines-misleading-capture-default-by-value,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
 
url/url.cpp added: 4, removed: 6, total 0
@@ -29,6 +29,7 @@
#include <cstdlib>
#include <iostream>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
@@ -1187,7 +1188,7 @@ std::optional<std::string> UrlParser::domain_to_ascii(std::string_view domain, b
opts |= UIDNA_USE_STD3_RULES;
}
 
auto *uts = icu::IDNA::createUTS46Instance(opts, err);
auto uts = std::unique_ptr<icu::IDNA>{icu::IDNA::createUTS46Instance(opts, err)};
 
if (U_FAILURE(err) != 0) {
std::cerr << "Failed to create UTS46 instance: " << u_errorName(err) << '\n' << std::flush;
@@ -1198,8 +1199,6 @@ std::optional<std::string> UrlParser::domain_to_ascii(std::string_view domain, b
 
uts->nameToASCII_UTF8(domain, tmp, inf, err);
 
delete uts;
 
std::uint32_t proc_err = inf.getErrors();
 
// icu doesn't offer a flag to disable VerifyDnsLength or CheckHyphens, so just ignore those failures