--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ return N; return N; size_t x = base::size(non_empty_array); size_t x = base::size(empty_array); size_t x = ARRAY_LENGTH(non_empty_array); size_t x = ARRAY_LENGTH(empty_array); size_t x = base::size(empty_array); ^ constexpr size_t size(const T (&array)[N]) noexcept { ^~~~ size_t x = base::size(empty_array); ^~~~~~~~~~ ^ ~ --- /third_party/blink/renderer/platform/text/character.cc +++ /third_party/blink/renderer/platform/text/character.cc @@ -63,9 +63,13 @@ return unicodeSet; } -#define CREATE_UNICODE_SET(name) \ - createUnicodeSet(name##Array, base::size(name##Array), name##Ranges, \ - base::size(name##Ranges)) +// base::size (from base/stl_util.h) causes compilation errors +// with zero-length arrays. +#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) + +#define CREATE_UNICODE_SET(name) \ + createUnicodeSet(name##Array, ARRAY_LENGTH(name##Array), \ + name##Ranges, ARRAY_LENGTH(name##Ranges)) #define RETURN_HAS_PROPERTY(c, name) \ static icu::UnicodeSet* unicodeSet = nullptr; \ --- /third_party/blink/renderer/platform/text/character_property_data_generator.cc +++ /third_party/blink/renderer/platform/text/character_property_data_generator.cc @@ -22,6 +22,9 @@ #else const UChar32 kMaxCodepoint = 0x10FFFF; + +// base::size (from base/stl_util.h) causes compilation errors +// with zero-length arrays. #define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) static void SetRanges(CharacterProperty* values,