diff --git a/icu4c/source/test/fuzzer/relative_date_time_formatter_fuzzer.cpp b/icu4c/source/test/fuzzer/relative_date_time_formatter_fuzzer.cpp index 007d350f2c9..afcf57d858d 100644 --- a/icu4c/source/test/fuzzer/relative_date_time_formatter_fuzzer.cpp +++ b/icu4c/source/test/fuzzer/relative_date_time_formatter_fuzzer.cpp @@ -4,6 +4,7 @@ // Fuzzer for ICU RelativeDateTimeFormatter. #include +#include #include "fuzzer_utils.h" @@ -48,8 +49,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { context = validCapitalizations[ static_cast(context) % (sizeof(validCapitalizations) / sizeof(UDisplayContext))]; - formatter.reset(new icu::RelativeDateTimeFormatter( - locale, nullptr, style, context, status)); + formatter = + std::make_unique(locale, nullptr, style, context, status); if (U_SUCCESS(status)) { URelativeDateTimeUnit unit; diff --git a/icu4c/source/tools/genrb/filterrb.cpp b/icu4c/source/tools/genrb/filterrb.cpp index dcc02fc6210..d6480968742 100644 --- a/icu4c/source/tools/genrb/filterrb.cpp +++ b/icu4c/source/tools/genrb/filterrb.cpp @@ -2,6 +2,7 @@ // License & terms of use: http://www.unicode.org/copyright.html #include +#include #include #include "filterrb.h" @@ -150,7 +151,7 @@ SimpleRuleBasedPathFilter::Tree::Tree(const Tree& other) : fIncluded(other.fIncluded), fChildren(other.fChildren) { // Note: can't use the default copy assignment because of the std::unique_ptr if (other.fWildcard) { - fWildcard.reset(new Tree(*other.fWildcard)); + fWildcard = std::make_unique(*other.fWildcard); } } @@ -181,7 +182,7 @@ void SimpleRuleBasedPathFilter::Tree::applyRule( if (key == "*") { // Case 1: Wildcard if (!fWildcard) { - fWildcard.reset(new Tree()); + fWildcard = std::make_unique(); } // Apply the rule to fWildcard and also to all existing children. it++;