From c3ed0c5371f4fb4e2a0b2e945ecaa3e1c7740e1d Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Mon, 7 Dec 2020 19:43:09 -0800 Subject: [PATCH] ICU-21430 propagate error code --- icu4c/source/common/locid.cpp | 4 ++-- icu4c/source/test/intltest/loctest.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index 18947685dca..de09a697191 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -1093,7 +1093,7 @@ public: // place the the replaced locale ID in out and return true. // Otherwise return false for no replacement or error. bool replace( - const Locale& locale, CharString& out, UErrorCode status); + const Locale& locale, CharString& out, UErrorCode& status); private: const char* language; @@ -1641,7 +1641,7 @@ AliasReplacer::outputToString( } bool -AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode status) +AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status) { data = AliasData::singleton(status); if (U_FAILURE(status)) { diff --git a/icu4c/source/test/intltest/loctest.cpp b/icu4c/source/test/intltest/loctest.cpp index 96045f4f14e..3538cc8eb94 100644 --- a/icu4c/source/test/intltest/loctest.cpp +++ b/icu4c/source/test/intltest/loctest.cpp @@ -6442,4 +6442,5 @@ void LocaleTest::TestLeak21419() { IcuTestErrorCode status(*this, "TestLeak21419"); Locale l = Locale("s-yU"); l.canonicalize(status); + status.expectErrorAndReset(U_ILLEGAL_ARGUMENT_ERROR); } -- 2.40.0