aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-10-11 09:07:15 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-10-11 20:34:16 +0100
commit84088dc4bb6a546c896a068dc201463493babf43 (patch)
tree1b9cda7ec87970a26092a41745ce184fd3907ce6 /gcc/tree-vect-loop.c
parent008e7397dad971c03c08fc1b0a4a98fddccaaed8 (diff)
downloadgcc-84088dc4bb6a546c896a068dc201463493babf43.zip
gcc-84088dc4bb6a546c896a068dc201463493babf43.tar.gz
gcc-84088dc4bb6a546c896a068dc201463493babf43.tar.bz2
libstdc++: Fix std::match_results::end() for failed matches [PR102667]
The end() function needs to consider whether the underlying vector is empty, not whether the match_results object is empty. That's because the underlying vector will always contain at least three elements for a match_results object that is "ready". It contains three extra elements which are stored in the vector but are not considered part of sequence, and so should not be part of the [begin(),end()) range. libstdc++-v3/ChangeLog: PR libstdc++/102667 * include/bits/regex.h (match_result::empty()): Optimize by calling the base function directly. (match_results::end()): Check _Base_type::empty() not empty(). * testsuite/28_regex/match_results/102667.C: New test.
Diffstat (limited to 'gcc/tree-vect-loop.c')
0 files changed, 0 insertions, 0 deletions