<regex>: Remove error_syntax
#5542
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #438. There were two remaining uses of
error_syntax:?is essentially a quantifier applied to nothing, soerror_badrepeatseems an apt choice among the available codes to me. (The error codeerror_parenused by libstdc++ feels a bit weird to me in this context because this error code is intended for unbalanced parentheses, which this isn't.)_STL_INTERNAL_CHECK:_Alternative()only returns normally when_Mcharis_Meta_eos,_Meta_baror it is_Meta_rparwhile_Disj_count != 0. Its caller,_Disjunction(), only returns if_Mcharis not_Meta_barafter_Alternative()returned. So this means the error could only be thrown when_Mcharis_Meta_eosor_Meta_rparwith_Disj_count != 0. But in either case, this is a bug in the parser: Either_Meta_eoswas assigned to_Mcharbefore the end of the regex was reached (but see_Trans()for the only case where_Meta_eosis assigned) or an unbalanced number of increments and decrements toDisj_countwere performed.