Jonathan Wakely
authored
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.
Name | Last commit | Last update |
---|