c: can't compile tests with UBSan

Description

Similar to - can't compile intltest with the UBS sanitizer ( clang++ -fsanitize=undefined ) without the following:

1 2 3 4 5 Undefined symbols for architecture x86_64: "typeinfo for icu_64::CollationCacheEntry", referenced from: l___unnamed_1723 in usettest.o "typeinfo for icu_64::numparse::impl::CodePointMatcher", referenced from: l___unnamed_410 in numbertest_parse.o

is U_I18N_API the right macro? or U_EXPORT?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 diff --git a/icu4c/source/i18n/collationtailoring.h b/icu4c/source/i18n/collationtailoring.h index 9a636cf1eb..5e71bd47ed 100644 --- a/icu4c/source/i18n/collationtailoring.h +++ b/icu4c/source/i18n/collationtailoring.h @@ -92,7 +92,7 @@ struct U_I18N_API CollationTailoring : public SharedObject { CollationTailoring(const CollationTailoring &other); }; -struct CollationCacheEntry : public SharedObject { +struct U_EXPORT CollationCacheEntry : public SharedObject { CollationCacheEntry(const Locale &loc, const CollationTailoring *t) : validLocale(loc), tailoring(t) { if(t != NULL) { diff --git a/icu4c/source/i18n/numparse_affixes.h b/icu4c/source/i18n/numparse_affixes.h index e02b17ba2d..d7ca3d3ad3 100644 --- a/icu4c/source/i18n/numparse_affixes.h +++ b/icu4c/source/i18n/numparse_affixes.h @@ -27,8 +27,7 @@ using ::icu::number::impl::AffixPatternProvider; using ::icu::number::impl::TokenConsumer; using ::icu::number::impl::CurrencySymbols; - -class CodePointMatcher : public NumberParseMatcher, public UMemory { +class U_EXPORT CodePointMatcher : public NumberParseMatcher, public UMemory { public: CodePointMatcher() = default; // WARNING: Leaves the object in an unusable state

Status

Assignee

Steven R. Loomis

Reporter

Steven R. Loomis

Labels

None

Reviewer

None

Time Needed

Minutes

Start date

None

Components

Fix versions

Priority

trivial