diff --git a/icu4c/source/common/resbund.cpp b/icu4c/source/common/resbund.cpp index 41337cdc155d..4c14dae133ee 100644 --- a/icu4c/source/common/resbund.cpp +++ b/icu4c/source/common/resbund.cpp @@ -388,7 +388,7 @@ const Locale &ResourceBundle::getLocale() const { return ncThis->fLocale != nullptr ? *ncThis->fLocale : Locale::getDefault(); } -const Locale ResourceBundle::getLocale(ULocDataLocaleType type, UErrorCode &status) const +Locale ResourceBundle::getLocale(ULocDataLocaleType type, UErrorCode &status) const { return ures_getLocaleByType(fResource, type, &status); } diff --git a/icu4c/source/common/unicode/resbund.h b/icu4c/source/common/unicode/resbund.h index 3965371729d8..03ff6faee239 100644 --- a/icu4c/source/common/unicode/resbund.h +++ b/icu4c/source/common/unicode/resbund.h @@ -450,7 +450,7 @@ class U_COMMON_API ResourceBundle : public UObject { * @return a Locale object * @stable ICU 2.8 */ - const Locale + Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const; #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index bc3a6420831e..8028c4ecf5cb 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -1051,7 +1051,7 @@ TimeZone::countEquivalentIDs(const UnicodeString& id) { // --------------------------------------- -const UnicodeString U_EXPORT2 +UnicodeString U_EXPORT2 TimeZone::getEquivalentID(const UnicodeString& id, int32_t index) { U_DEBUG_TZ_MSG(("gEI(%d)\n", index)); UnicodeString result; diff --git a/icu4c/source/i18n/unicode/messageformat2_data_model.h b/icu4c/source/i18n/unicode/messageformat2_data_model.h index aaef4da077b1..fd9b6432a5d1 100644 --- a/icu4c/source/i18n/unicode/messageformat2_data_model.h +++ b/icu4c/source/i18n/unicode/messageformat2_data_model.h @@ -2330,7 +2330,7 @@ namespace message2 { * @internal ICU 75 technology preview * @deprecated This API is for technology preview only. */ - const std::vector getSelectors() const { + std::vector getSelectors() const { if (std::holds_alternative(body)) { return {}; } diff --git a/icu4c/source/i18n/unicode/timezone.h b/icu4c/source/i18n/unicode/timezone.h index b19900b76712..9591b7d90aff 100644 --- a/icu4c/source/i18n/unicode/timezone.h +++ b/icu4c/source/i18n/unicode/timezone.h @@ -323,7 +323,7 @@ class U_I18N_API TimeZone : public UObject { * @see #countEquivalentIDs * @stable ICU 2.0 */ - static const UnicodeString U_EXPORT2 getEquivalentID(const UnicodeString& id, + static UnicodeString U_EXPORT2 getEquivalentID(const UnicodeString& id, int32_t index); /** diff --git a/icu4c/source/tools/ctestfw/datamap.cpp b/icu4c/source/tools/ctestfw/datamap.cpp index 3370a75b307d..1770b293ff06 100644 --- a/icu4c/source/tools/ctestfw/datamap.cpp +++ b/icu4c/source/tools/ctestfw/datamap.cpp @@ -116,7 +116,7 @@ const ResourceBundle *RBDataMap::getItem(const char* key, UErrorCode &status) co } } -const UnicodeString RBDataMap::getString(const char* key, UErrorCode &status) const +UnicodeString RBDataMap::getString(const char* key, UErrorCode &status) const { const ResourceBundle *r = getItem(key, status); if(U_SUCCESS(status)) { diff --git a/icu4c/source/tools/ctestfw/unicode/datamap.h b/icu4c/source/tools/ctestfw/unicode/datamap.h index b4f7f82fd64b..e243eb71e204 100644 --- a/icu4c/source/tools/ctestfw/unicode/datamap.h +++ b/icu4c/source/tools/ctestfw/unicode/datamap.h @@ -40,7 +40,7 @@ class T_CTEST_EXPORT_API DataMap { * @param key name of the data field. * @return a string containing the data */ - virtual const UnicodeString getString(const char* key, UErrorCode &status) const = 0; + virtual UnicodeString getString(const char* key, UErrorCode &status) const = 0; /** get the string from the DataMap. Addressed by name * parses a bundle string into an integer @@ -121,7 +121,7 @@ class T_CTEST_EXPORT_API RBDataMap : public DataMap{ virtual const ResourceBundle *getItem(const char* key, UErrorCode &status) const; - virtual const UnicodeString getString(const char* key, UErrorCode &status) const override; + virtual UnicodeString getString(const char* key, UErrorCode &status) const override; virtual int32_t getInt28(const char* key, UErrorCode &status) const override; virtual uint32_t getUInt28(const char* key, UErrorCode &status) const override; virtual const int32_t *getIntVector(int32_t &length, const char *key, UErrorCode &status) const override;