aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-01-09 14:43:40 +0000
committerJonathan Wakely <jwakely@redhat.com>2024-01-09 23:42:59 +0000
commitea314ccd625aada7ed8a324ac07cfc3a8aa0f03f (patch)
treeb03d717b348e1e57fc96a9a49cf0776d05132ec3 /gcc
parent6002a3cd39c984423c59255ac780efb8b668b73a (diff)
downloadgcc-ea314ccd625aada7ed8a324ac07cfc3a8aa0f03f.zip
gcc-ea314ccd625aada7ed8a324ac07cfc3a8aa0f03f.tar.gz
gcc-ea314ccd625aada7ed8a324ac07cfc3a8aa0f03f.tar.bz2
libstdc++: Fix Unicode property detection functions
Fix some copy & pasted logic in __is_extended_pictographic. This function should yield false for the values before the first edge, not true. Also add a missing boundary condition check in __incb_property. Also Fix an off-by-one error in _Utf_iterator::operator++() that would make dereferencing a past-the-end iterator undefined (where the intended design is that the iterator is always incrementable and dereferenceable, for better memory safety). Also simplify the grapheme view iterator, which still contained some remnants of an earlier design I was experimenting with. Slightly tweak the gen_libstdcxx_unicode_data.py script so that the _Gcb_property enumerators are in the order we encounter them in the data file, instead of sorting them alphabetically. Start with the "Other" property at value 0, because that's the default property for anything not in the file. This makes no practical difference, but seems cleaner. It causes the values in the __gcb_edges table to change, so can only be done now before anybody is using this code yet. The enumerator values and table entries become ABI artefacts for the function using them. contrib/ChangeLog: * unicode/gen_libstdcxx_unicode_data.py: Print out Gcb_property enumerators in the order they're seen, not alphabetical order. libstdc++-v3/ChangeLog: * include/bits/unicode-data.h: Regenerate. * include/bits/unicode.h (_Utf_iterator::operator++()): Fix off by one error. (__incb_property): Add missing check for values before the first edge. (__is_extended_pictographic): Invert return values to fix copy&pasted logic. (_Grapheme_cluster_view::_Iterator): Remove second iterator member and find end of cluster lazily. * testsuite/ext/unicode/grapheme_view.cc: New test. * testsuite/ext/unicode/properties.cc: New test. * testsuite/ext/unicode/view.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions