aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-12-14 13:31:11 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-12-14 21:45:45 +0000
commit63bb98e1c1eabaa9a68e8a6270663f2dfff047d8 (patch)
tree008801da58d2fbf27e15866f335f813f5d2363bd /gcc
parent926d64906af2efc8714d37e6db2171784cfa60cd (diff)
downloadgcc-63bb98e1c1eabaa9a68e8a6270663f2dfff047d8.zip
gcc-63bb98e1c1eabaa9a68e8a6270663f2dfff047d8.tar.gz
gcc-63bb98e1c1eabaa9a68e8a6270663f2dfff047d8.tar.bz2
libstdc++: Simplify definition of std::regex_constants variables
This removes the __syntax_option and __match_flag enumeration types, which are only used to define enumerators with successive values that are then used to initialize the std::regex_constants global variables. By defining enumerators in the syntax_option_type and match_flag_type enumeration types with the correct values for the globals we get rid of two useless enumeration types that just count from 0 to N, and we improve the debugging experience. Because the enumeration types now have enumerators defined, GDB will print values in terms of those enumerators e.g. $6 = (std::regex_constants::_S_ECMAScript | std::regex_constants::_S_multiline) Previously this would have been shown as simply 0x810 because there were no enumerators of that type. This changes the type and value of enumerators such as _S_grep, but users should never be referring to them directly anyway. libstdc++-v3/ChangeLog: * include/bits/regex_constants.h (__syntax_option, __match_flag): Remove. (syntax_option_type, match_flag_type): Define enumerators. Use to initialize globals. Add constexpr to compound assignment operators. * include/bits/regex_error.h (error_type): Add comment. * testsuite/28_regex/constants/constexpr.cc: Remove comment. * testsuite/28_regex/constants/error_type.cc: Improve comment. * testsuite/28_regex/constants/match_flag_type.cc: Check bitmask requirements. * testsuite/28_regex/constants/syntax_option_type.cc: Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions