diff --git a/icu4c/source/i18n/numrange_fluent.cpp b/icu4c/source/i18n/numrange_fluent.cpp index a02ae5b9c2c1..b2e1b34fe7ae 100644 --- a/icu4c/source/i18n/numrange_fluent.cpp +++ b/icu4c/source/i18n/numrange_fluent.cpp @@ -245,10 +245,10 @@ LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter(LocalizedNumberRang : LNF(static_cast&&>(src)) {} LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter(NFS&& src) noexcept - : NFS(std::move(src)) { + : NFS(std::move(src)) { + // Safely access the member from *this, which holds the moved-from state // Steal the compiled formatter - LNF&& _src = static_cast(src); - auto* stolen = _src.fAtomicFormatter.exchange(nullptr); + auto* stolen = this->fAtomicFormatter.exchange(nullptr); delete fAtomicFormatter.exchange(stolen); }